Re: [PHP] eval and HEREDOC

2010-07-21 Thread Peter Lind
On 21 July 2010 06:46, Sorin Buturugeanu m...@soin.ro wrote: @Vincent: no, the short tags are not off. @Jim: This seamns to work fine: $template = file_get_contents(pathTemplates.$this-dir.$this-tpl); ob_start(); $template = eval('?'.$template); $template = ob_get_clean(); Thanks! Best

Re: [PHP] eval and HEREDOC

2010-07-21 Thread Sorin Buturugeanu
Hi Peter! In the first version of the template engine I had markers but now I need more complex conditions or operations inside the template files, like array of arrays and so on. I really like the freedom to be able to just open a PHP tag ? ? and use a foreach() or whatever PHP function as I

RE: [PHP] eval and HEREDOC

2010-07-20 Thread Daevid Vincent
-Original Message- From: Sorin Buturugeanu [mailto:m...@soin.ro] Sent: Tuesday, July 20, 2010 2:11 PM To: php-general@lists.php.net Subject: [PHP] eval and HEREDOC Hello, I am having trouble with a part of my templating script. I'll try to explain: The template itself is

Re: [PHP] eval and HEREDOC

2010-07-20 Thread Sorin Buturugeanu
Hello Vincent and thank you for your reply :). That's true, I forgot to explain how I got to using HEREDOC, so .. Using eval(file_get_contents($file)) just outputs the result on the spot and I need to get the whole output (without echoing it) and do some more things with it. require_once()

Re: [PHP] eval and HEREDOC

2010-07-20 Thread lists
On Wed, 21 Jul 2010 01:04:12 +0300, Sorin Buturugeanu m...@soin.ro wrote: Hello Vincent and thank you for your reply :). That's true, I forgot to explain how I got to using HEREDOC, so .. Using eval(file_get_contents($file)) just outputs the result on the spot and I need to

Re: [PHP] eval and HEREDOC

2010-07-20 Thread Sorin Buturugeanu
@Vincent: no, the short tags are not off. @Jim: This seamns to work fine: $template = file_get_contents(pathTemplates.$this-dir.$this-tpl); ob_start(); $template = eval('?'.$template); $template = ob_get_clean(); Thanks! Best wishes! Sorin -- Sorin Buturugeanu http://www.soin.ro On Wed,