Re: getStatic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



str_replace will take arrays for "before" and "after" sequences.

So, build arrays, and do ONE str_replace and Bob's your uncle.

Another option, a bit crude, but effective, would be to wrap your template-y bit in a function that calls 'extract' on an array of variable names.

class Template_thingie {

private $vars = array();

public function template_register_variable($varname){
  $vars[] = $varname;
}

function template_render_whatsit(){
  extract($vars);
  include("some_file_$foo_here.php");
}

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux