|
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 |
ihabovich Smarty n00b
Joined: 11 Feb 2014 Posts: 2
|
Posted: Tue Feb 11, 2014 8:29 am Post subject: Help assigning titles for each page by smarty |
|
|
Hello,
I need help assigning page.title for each page. I assigned the following code in example.php
Code: |
$smarty->assign("page", array(array(
"title" => "Hello",
"description" => "description of page",
"keywords" => "keywords here",
)));
|
and called the value as {$page.title} but got nothing. I have the smarty debugger for assigned template variables as follow:
Code: |
$page
Smarty_Variable Object (3)
->value = Array (1)
0 => Array (3)
title => "Hello"
description => "description of page"
keywords => "keywords here"
->nocache = false
->scope = "Smarty root"
|
So what was the problem ??
Thnx in advance |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue Feb 11, 2014 6:00 pm Post subject: |
|
|
You one array(...) too much.
Code: | $smarty->assign("page", array(
"title" => "Hello",
"description" => "description of page",
"keywords" => "keywords here",
)); |
|
|
Back to top |
|
ihabovich Smarty n00b
Joined: 11 Feb 2014 Posts: 2
|
Posted: Tue Feb 11, 2014 8:37 pm Post subject: |
|
|
Thanks alot, It worked like perfect. |
|
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
|