|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
appel Smarty Rookie
Joined: 27 May 2003 Posts: 29
|
Posted: Wed May 28, 2003 12:30 pm Post subject: this is it, but need smarty method for it :) |
|
|
Oh, sorry, this belongs to another thread. Oh well, what this does it takes a template and returns all the variables defined in it.
Code: | preg_match_all('/{\$(.*?)}/',implode('',file('templates/index.tpl')),$arrReturned,2);
for($intA = 0; sizeof($arrReturned) > $intA; $intA++) {
$arrModules[] = $arrReturned[$intA][1];
}
echo "<pre>Modules in template:\n-----------------------------------------------------------\n";
print_r($arrModules);
echo "-----------------------------------------------------------"; |
|
|
Back to top |
|
Tom Sommer Administrator
Joined: 16 Apr 2003 Posts: 47 Location: Denmark
|
Posted: Fri May 30, 2003 6:22 pm Post subject: |
|
|
can't you just use $smarty->get_template_vars() ? |
|
Back to top |
|
AZTEK Smarty Pro
Joined: 16 Apr 2003 Posts: 235 Location: Purdue University
|
Posted: Fri May 30, 2003 8:06 pm Post subject: |
|
|
No he means getting the list of variables that are accessed in the template. _________________ "Imagine a school with children that can read and write, but with teachers who cannot, and you have a metaphor of the Information Age in which we live." -Peter Cochrane |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|