View Source

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[{zone-template-instance:ZFDEV:Zend Proposal Zone Template}



1.1 - 1 August 2006: Updated from community comments.

The general idea is to allow developers to code an application with error_reporting(E_ALL | E_STRICT); while allowing Zend_View scripts to execute with the same error reporting MINUS E_NOTICE. The idea here is that during script execution, there is generally a lower level of strictness when it comes to using an object that may not have a pre-set property or using an array without a preset key.

* [Similar Trick in PHP Manual |]

This api addition would require a public method called supressNotices($bool) that accepts a bool on whether to include that functionality at rendertime.

* Zend_View

The component is instantiated with a mind-link that ...

Describe some intermediate state of this component in terms of design notes, additional material added to this page, and / code. Note any significant dependencies here, such as, "Milestone #3 can not be completed until feature Foo has been added to ZF component XYZ." Milestones will be required for acceptance of future proposals. They are not hard, and many times you will only need to think of the first three below.
* Milestone 1: [design notes will be published here|]
* Milestone 2: Working prototype checked into the incubator supporting use cases #1, #2, ...
* Milestone 3: Working prototype checked into the incubator supporting use cases #3 and #4.
* Milestone 4: Unit tests exist, work, and are checked into SVN.
* Milestone 5: Initial documentation exists.

If a milestone is already done, begin the description with "\[DONE\]", like this:
* Milestone #: \[DONE\] Unit tests ...

no classes


Typically, a single form might be used for both the C and the U in the CRUD mantra. Imagine using Zend_Db_Table for this CRUD application, and that for updating you have passed the row object to the form.phtml script. The current only way to suppress notices is by doing the following.


<form action="/form-admin/save/" method="POST">

Date <br />
<?= $this->formText('date', @$this->rowthing->date); ?>
<br /><br />

Topic<br />
<?= $this->formText('topic', @$this->rowthing->topic); ?>
<br /><br />

Abstract<br />
<?= $this->formTextarea('abstract', @$this->rowthing->abstract); ?>
<br /><br />

<input type="submit" value="Save" />



The problem with the above is that if Zend_Db_Table_Row decides to throw an error, that will get suppressed as well as the @ does not discriminate.

The following (similar) code would be needed at render time
error_reporting($_viewPreviousErrorLevel& ~E_NOTICE);
// script execution here