-- Julian Davchev <[EMAIL PROTECTED]> wrote
(on Friday, 07 March 2008, 04:18 PM +0200):
> I see in documentation everywhere using <?=
> Shouldn't ZF not tolerate short tag notation and provide examples as
> <?php print... instead?

First off, 'echo', not 'print' -- echo is the preferred function when
sending output in PHP; print is an alias to it.

Second, we use short tags when showing view scripts, as the notation is
more suited for intermingling with HTML; we also typically show the
alternate forms of logic operators:

    <? foreach ($foo as $bar): ?>
    ...
    <? endforeach ?>

These conventions in our *view scripts* lead to greater readability and
management of your display logic.

Note, however, tha, we restrict this usage in our examples to *view
scripts only*, as we have in our coding standards a requirement for
using full <?php opening tags for class files.

I plan on adding a stream wrapper to Zend_View to allow using short tags
even if short_tags is disabled in your php.ini so that the examples we
have will work regardless of your settings.

-- 
Matthew Weier O'Phinney
PHP Developer            | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to