Closed xro closed 11 years ago
It seems Smarty isn't loaded at all. Make sure that you added 'MaxnufSmarty' to 'modules' in the config/application.config.php file.
Thanks for reply. Managed to have operational maxnufsmarty now (fixed my config entries). ..but the other issue came out.
say this works perfectly: {$this->doctype()} but having something like: {$this->headScript()->prependFile($this->basePath() . '/js/html5.js', 'text/javascript', array('conditional' => 'lt IE 9',)) ->prependFile($this->basePath() . '/js/bootstrap.min.js') ->prependFile($this->basePath() . '/js/jquery.min.js')} will throw SmartyCompilerException with Syntax Error message. Its due to concatenation struff (me thinks). So wanted just to do {php} echo $this->headScript()->prependFile($this->basePath() . '/js/html5.js', 'text/javascript', array('conditional' => 'lt IE 9',)) ->prependFile($this->basePath() . '/js/bootstrap.min.js') ->prependFile($this->basePath() . '/js/jquery.min.js'); {/php}
but seems php tag is faulty with your implementation getting error 'Zend\ServiceManager\Exception\ServiceNotFoundException' with message 'Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for php
Tried to resolve it myself but no fun. This issue is probably more interesting for you:)
well can't and shouldn't use {php} tags, they are deprecated. See http://www.smarty.net/docs/en/language.function.php.tpl
I'm not sure why concatenation doesn't work. I'll look into it. In the meantime you could maybe work around this issue by assigning it to a variable first using {assign}?
Yeah concatenation with the .-operator like php won't work, because the . is special in smarty for array access.
I'd the same problem but i solved it with the cat modifier from smarty.
so instead of prependFile($this->basePath() . '/js/jquery.min.js')} simply write prependFile($this->basePath()|cat:'/js/jquery.min.js')}
the cat modifier will work. note that you'll also get trouble using
array('foo' => 'bar')
simply use '[ ]' instead
['foo' => 'bar']
First of all thanks for creating this stuff. As integrating smarty into ZF2 for framework newbies is nightmare.
Second, have installed your module but in templates I get displayed {$this->doctype()} instead of having doctype executed and outputted. Any possible reasons? thanks