This is a really good point, Marco. Of course, this would be much cleaner with a set of functions, since $this (whatever it is) is not truly a dependency for any of these functions - they're likely sharing no context or state; they've likely been placed in the class solely to make them available to the template, which is a work-around creating a class dependency for no real reason.
Now, if we could autoload functions...... :-) On Wed, Jul 20, 2016 at 8:30 PM, Marco Pivetta <ocram...@gmail.com> wrote: > The syntax is weird as heck. > > That said, frameworks without templating engine already have escaping > helpers, for example: > <?= $this->escapeHtml($value); ?> > <?= $this->escapeHtmlAttr($value); ?> > <?= $this->escapeJs($value); ?> > <?= $this->escapeCss($value); ?> > > I don't see what is hard in using that syntax, plus it's not a global > registry. > > Marco Pivetta > > http://twitter.com/Ocramius > > http://ocramius.github.com/ > > On Wed, Jul 20, 2016 at 8:17 PM, Michael Vostrikov < > michael.vostri...@gmail.com> wrote: > > > > Personally I don't know any developer who is using raw php in project > > without template engine > > > > Zend, Yii, various CMS like Wordperss, internal business-applications - > in > > many cases such projects don't have a template engine. > > I usually work with Yii and internal applications on custom engines. This > > is the reason why I raised this question. > > By the way, the syntax is not weird. It is just <?* $var1, $var2 ?>. How > to > > use $var2 is fully up to application. > > >