 |
Smarty
The discussions here are for Smarty, a template engine for the PHP programming language. Dedicated server web hosting provided by Guru-host.eu. |
| View previous topic :: View next topic |
| Author |
Message |
fl3x7 Smarty Rookie
Joined: 12 Feb 2011 Posts: 8
|
Posted: Sun Apr 22, 2012 10:05 pm Post subject: Smarty 3 assign variable in template |
|
|
Hello,
Having a bit of a problem. Trying to assign a template variable within a smarty 3 template file but it doesnt seem to register it.
I know I can use this in the controller:
$this->data['myVar'] = 'something';
But dont want to use that. I have tried this:
{assign var="myVar" value="something" noache}
But for some reason it just doesnt seem to work.
The template this is being used in is extending another template.
I have tried setting the variable scope to global.
The other weird thing is even if i try and assign a variable which is then just being outputted just below (in the same template file), it still returns empty as if the assign method is not doing anything at all. No errors though.
I am using smarty in conjunction with code igniter if that helps
Hope someone can shed some light,
Thanks for reading. |
|
| Back to top |
|
fl3x7 Smarty Rookie
Joined: 12 Feb 2011 Posts: 8
|
Posted: Mon Apr 23, 2012 11:04 pm Post subject: |
|
|
I ended up just using {block}{/block} for this as I was extending templates anyway.
Hope this helps someone else. |
|
| 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
|