shouldn't ZF promote not using short tags

View: New views
5 Messages — Rating Filter:   Alert me  

shouldn't ZF promote not using short tags

by Julian Davchev :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
I see in documentation everywhere using <?=
Shouldn't ZF not tolerate short tag notation and provide examples as
<?php print... instead?
Regards

Re: shouldn't ZF promote not using short tags

by weierophinney :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-- Julian Davchev <jmut@...> 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            | matthew@...
Zend - The PHP Company   | http://www.zend.com/

Re: shouldn't ZF promote not using short tags

by thomasW :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

+1 from me...

This is an issue of coding standard and many people do not have enabled
short tags for security or other reasons.

Greetings
Thomas Weidner, I18N Team Leader
http://www.thomasweidner.com

----- Original Message -----
From: "Julian Davchev" <jmut@...>
To: "Zend Framework General" <fw-general@...>
Sent: Friday, March 07, 2008 3:18 PM
Subject: [fw-general] shouldn't ZF promote not using short tags


> Hi,
> I see in documentation everywhere using <?=
> Shouldn't ZF not tolerate short tag notation and provide examples as
> <?php print... instead?
> Regards


Re: shouldn't ZF promote not using short tags

by weierophinney :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-- Thomas Weidner <thomas.weidner@...> wrote
(on Friday, 07 March 2008, 03:52 PM +0100):
> +1 from me...
>
> This is an issue of coding standard and many people do not have enabled
> short tags for security or other reasons.

As noted in my response, I plan on adding a stream wrapper to Zend_View
so that short tags can be supported out-of-the-box by Zend_View even if
short tags are disabled. The readability benefits of using short tags in
view scripts make it a worthwhile practice.

> ----- Original Message ----- From: "Julian Davchev" <jmut@...>
> To: "Zend Framework General" <fw-general@...>
> Sent: Friday, March 07, 2008 3:18 PM
> Subject: [fw-general] shouldn't ZF promote not using short tags
>
>
> > Hi,
> > I see in documentation everywhere using <?=
> > Shouldn't ZF not tolerate short tag notation and provide examples as
> > <?php print... instead?

--
Matthew Weier O'Phinney
PHP Developer            | matthew@...
Zend - The PHP Company   | http://www.zend.com/

Re: shouldn't ZF promote not using short tags

by Julian Davchev :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yep, that would be great indeed.
Let me know if can watch some ticket or something on progress...would be
good.
If not, will wait to hear on mailinglist for this great feature.

Matthew Weier O'Phinney wrote:

> -- Thomas Weidner <thomas.weidner@...> wrote
> (on Friday, 07 March 2008, 03:52 PM +0100):
>  
>> +1 from me...
>>
>> This is an issue of coding standard and many people do not have enabled
>> short tags for security or other reasons.
>>    
>
> As noted in my response, I plan on adding a stream wrapper to Zend_View
> so that short tags can be supported out-of-the-box by Zend_View even if
> short tags are disabled. The readability benefits of using short tags in
> view scripts make it a worthwhile practice.
>
>  
>> ----- Original Message ----- From: "Julian Davchev" <jmut@...>
>> To: "Zend Framework General" <fw-general@...>
>> Sent: Friday, March 07, 2008 3:18 PM
>> Subject: [fw-general] shouldn't ZF promote not using short tags
>>
>>
>>    
>>> Hi,
>>> I see in documentation everywhere using <?=
>>> Shouldn't ZF not tolerate short tag notation and provide examples as
>>> <?php print... instead?
>>>      
>
>