resource - variable

From: Date: Mon, 15 Aug 2005 14:15:59 +0000
Subject: resource - variable
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-12964@lists.php.net to get a copy of this message
Hello, I have page content (string) in a variable {$page_content}. I can simply "echo" this content by smarty like this My content: {$page_content} I need to process smarty tags in this string. The content (string) can be saved into a file or database and then called by {include} plugin like this {include file="my-page-content.tpl"} and it will work. But I need something like resource-from-variable. I created the most simpliest piece of code which works. Important code parts: // resource function var_get_template($tpl_name, &$tpl_source, &$smarty_obj) { $tpl_source = $tpl_name; return TRUE; } ... ... $smarty->register_resource('var', array( $page, 'var_get_template', 'var_get_timestamp', 'var_get_secure', 'var_get_trusted' ) ); And template {include file="var:$page_content"} Does anybody have any hints about this? Thanks, Michal

« previous php.smarty.general (#12964) next »