I appreciate this piece of info, thank you a lot for the share!
Best Regards.
-----Mensaje original-----
De: Michal Tuláček [mailto:michal@tulacek.eu]
Enviado el: Viernes, 19 de Diciembre de 2008 04:53 p.m.
Para: fw-db@lists.zend.com
Asunto: Re: [fw-db] how to use <?= to echo vars in views scripts?
Hi,
according to Zend Framework reference guide, section 53.1.4 which is
about dealing with the short tags, there is possibility of transcoding
<?= to <?php echo by the view class shipped with ZF on the fly:
<cite>
Enable an optional stream wrapper to convert short tags to long tags on the
fly:
$view->setUseStreamWrapper(true);
This registers Zend_View_Stream as a stream wrapper for view scripts,
and will ensure that your code continues to work as if short tags were
enabled.
View Stream Wrapper Degrades Performance
Usage of the stream wrapper will degrade performance of your
application, though actual benchmarks are unavailable to quantify the
amount of degradation. We recommend that you either enable short tags,
convert your scripts to use full tags, or have a good partial and/or
full page content caching strategy in place.
</cite>
Sincerely,
Michal Tulacek
2008/12/19 Jiří Helmich <jiri@helmich.cz>:
> There is no rule. It's system admin, who makes the decision. The best
> practice is to avoid using <?= and <? tags.
>
>
>
> But you can extend the default view class like this (see the code in the
> last codebox):
>
>
>
>
http://blog.javorek.net/sablony-v-php-a-jak-obejit-nepodporu-short-open-tags
/
>
>
>
> Regards,
>
> Jiří
>
>
>
>
>
> From: Jaime Garcia [mailto:jgarcia@vali.com.mx]
> Sent: Friday, December 19, 2008 10:09 PM
> To: fw-db@lists.zend.com
> Subject: RE: [fw-db] how to use <?= to echo vars in views scripts?
>
>
>
> It worked great! thanks a lot Jiří =)
>
>
>
> BTW there is a warn about issues for unsuported servers, i know this isn't
> the correct list to ask this folks, but anyone knows if this
incompatibility
> is specific to any OS or just to have the right privileges on the server?
>
>
>
> Again, thank you for your help!!
>
>
>
> De: Jiří Helmich [mailto:jiri@helmich.cz]
> Enviado el: Viernes, 19 de Diciembre de 2008 02:19 p.m.
> Para: 'Jaime Garcia'; fw-db@lists.zend.com
> Asunto: RE: [fw-db] how to use <?= to echo vars in views scripts?
>
>
>
> Hi,
>
>
>
> you'll need to enable short_open_tag in php.ini.
>
>
>
> See http://cz2.php.net/ini.core for more information.
>
>
>
> Regards
>
> Jiří Helmich
>
>
>
> From: Jaime Garcia [mailto:jgarcia@vali.com.mx]
> Sent: Friday, December 19, 2008 9:15 PM
> To: fw-db@lists.zend.com
> Subject: [fw-db] how to use <?= to echo vars in views scripts?
>
>
>
> Hello friends,
>
> I've seen in some code examples in ZF documentation about echoing
variables
> in view scripts like this:
>
>
>
> <?= $this->var; ?>
>
>
>
> I tried out this in my view but doesn't seem to work, unless I put all
the
> echo instruction like this:
>
>
>
> <?php echo $this->var ?>
>
>
>
> Can anyone tell me how configure my project environment to work like the
> first option? I appreciate so much your help, thank you.
没有评论:
发表评论