|
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 |
ferre Smarty Rookie
Joined: 07 Jul 2003 Posts: 28
|
Posted: Wed Jul 16, 2003 3:24 pm Post subject: variable need help |
|
|
plz, help me , this drive me crazy , my structure below
--------------------------------------
config.php
$CF=array(
"SQL_HOST"=> "localhost",
"SQL_DB" => "catv",
"SQL_ID" => "root"
)
1 | index.php
include(config.php);
->display(head.tpl);
->display(index.tpl);
->display(foot.tpl);
2 | index.tpl
include(main.php);
3 | main.php
echo $CF['SQL_HOST'] ;echo $CF[SQL_HOST] ;
OUTPUT--->NOTHING , why? |
|
Back to top |
|
ferre Smarty Rookie
Joined: 07 Jul 2003 Posts: 28
|
Posted: Thu Jul 17, 2003 3:22 pm Post subject: |
|
|
anyone help....plz |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Thu Jul 17, 2003 4:00 pm Post subject: |
|
|
you have to say in your "main.php" .
if you include php code inside your smarty template you are not in global context, but inside a method of smarty. so you have no globals, but you have your smarty-object as $this |
|
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
|