View Single Post
Old 12-21-2007, 09:07 PM   #5 (permalink)
Tanax
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default

Quote:
Originally Posted by sjaq View Post
No, it won't.

It gets all the data out of the array so if you would like to replace {page} with the contents of $page you'll have to do something like this:
PHP Code:
<?php 

    $values 
= array(
        
'page' => $page
    
);

    
$tpl->parse('test'$values);

?>
Thanks! THat worked :D
Oh this is awesome ;)

Thanks a bunch!

Edit:
Can you explain this line?
PHP Code:
$replaced preg_replace_callback('/\{([a-z0-9\.]+)\}/i', array($this'replace_callback'), $contents); 
???
Tanax is offline  
Reply With Quote