Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

this is it, but need smarty method for it :)

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Feature Requests
View previous topic :: View next topic  
Author Message
appel
Smarty Rookie


Joined: 27 May 2003
Posts: 29

PostPosted: Wed May 28, 2003 12:30 pm    Post subject: this is it, but need smarty method for it :) Reply with quote

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
View user's profile Send private message
Tom Sommer
Administrator


Joined: 16 Apr 2003
Posts: 47
Location: Denmark

PostPosted: Fri May 30, 2003 6:22 pm    Post subject: Reply with quote

can't you just use $smarty->get_template_vars() ?
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
AZTEK
Smarty Pro


Joined: 16 Apr 2003
Posts: 235
Location: Purdue University

PostPosted: Fri May 30, 2003 8:06 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Feature Requests All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP