[PHP] ob_start eval?

2007-07-05 Thread blackwater dev

I have a template system that takes some data, scrubs it and then with a
load method includes the required template.  I need to add a param so it
doesn't simply include but returns the contents of the template in a string
with all of the vars populated.  I tried:

ob_start();
 include my template
$template=ob_get_contents();
ob_clean();
return $template;

But this returns the template it's it's raw for with all of tha
?=$whatever? tags.  Can I fill these in and still pass as another var
without using eval()?

What do other template systems to do return a template as a string on load?


Thanks!


Re: [PHP] ob_start eval?

2007-07-05 Thread Larry Garfield
If I understand what you're doing correctly, then it should work and I've done 
it many times.  First thing you should do, though, is switch from short tags 
to proper tags, ?php echo $whatever; ?.  If you have short tags disabled, 
it will not parse ?= syntax.

On Thursday 05 July 2007, blackwater dev wrote:
 I have a template system that takes some data, scrubs it and then with a
 load method includes the required template.  I need to add a param so it
 doesn't simply include but returns the contents of the template in a string
 with all of the vars populated.  I tried:

 ob_start();
   include my template
 $template=ob_get_contents();
 ob_clean();
 return $template;

 But this returns the template it's it's raw for with all of tha
 ?=$whatever? tags.  Can I fill these in and still pass as another var
 without using eval()?

 What do other template systems to do return a template as a string on load?


 Thanks!


-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it.  -- Thomas 
Jefferson

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] ob_start eval?

2007-07-05 Thread blackwater dev

We have short tags enabled as our templates work fine with them.

Thanks!

On 7/5/07, Larry Garfield [EMAIL PROTECTED] wrote:


If I understand what you're doing correctly, then it should work and I've
done
it many times.  First thing you should do, though, is switch from short
tags
to proper tags, ?php echo $whatever; ?.  If you have short tags
disabled,
it will not parse ?= syntax.

On Thursday 05 July 2007, blackwater dev wrote:
 I have a template system that takes some data, scrubs it and then with a
 load method includes the required template.  I need to add a param so it
 doesn't simply include but returns the contents of the template in a
string
 with all of the vars populated.  I tried:

 ob_start();
   include my template
 $template=ob_get_contents();
 ob_clean();
 return $template;

 But this returns the template it's it's raw for with all of tha
 ?=$whatever? tags.  Can I fill these in and still pass as another var
 without using eval()?

 What do other template systems to do return a template as a string on
load?


 Thanks!


--
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]  ICQ: 6817012

If nature has made any one thing less susceptible than all others of
exclusive property, it is the action of the thinking power called an idea,
which an individual may exclusively possess as long as he keeps it to
himself; but the moment it is divulged, it forces itself into the
possession
of every one, and the receiver cannot dispossess himself of it.  --
Thomas
Jefferson

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php