|
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 |
datamile Smarty Rookie
Joined: 17 May 2003 Posts: 13
|
Posted: Wed Jul 09, 2003 10:23 pm Post subject: passing parameters with include_php |
|
|
OK,
I'm using include_php in templates to enable template block functions.
Now many of the blocks are fairly common but with slightly different options depending on where there we called.
i.e. I do estate agent sites , and depending on the calling template , they may want the sales or letting search block...
Fundentially I would like to be able to pass a simple assign variable with include_php to pass a value to the code.
i.e. include_php("search_block.php","mode=sales") |
|
Back to top |
|
AZTEK Smarty Pro
Joined: 16 Apr 2003 Posts: 235 Location: Purdue University
|
Posted: Thu Jul 10, 2003 3:34 am Post subject: |
|
|
Code: | blah.tpl:
{assign var="mode" value="sales"}
{include_php file="blah.php"}
blah.php:
$mode = $this->get_template_vars("mode");
if($mode == "sales") {
// sales
} else {
// otherwise
} |
something like that should work _________________ "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
|