Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

What is wrong ?

 
Post new topic   Reply to topic    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
Jamarchi
Smarty Rookie


Joined: 06 Sep 2018
Posts: 10

PostPosted: Wed Nov 07, 2018 6:45 pm    Post subject: What is wrong ? Reply with quote

Hi

Iīm starting and I need to add some variables in one page
Code:
{include_php file="/info/variables.php"}

{php}
   $tittle=2;
   echo $tittle02;
   
   $tittle=2;
   
   if ($tittle==1){
     echo $tittle01;
   }else{
     echo $tittle02;
   }
{/php}


I tried to include a file variable.php that I have to show depend other information, in this case I will show the variable $tittle02 but I canīt see anything

I donīt know if the include has problem....

What can be wrong ?

Thank you
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1399

PostPosted: Thu Nov 08, 2018 4:20 am    Post subject: Reply with quote

Insertion of raw PHP code is not supported for several years now.
Back to top
View user's profile Send private message
Jamarchi
Smarty Rookie


Joined: 06 Sep 2018
Posts: 10

PostPosted: Thu Nov 08, 2018 1:02 pm    Post subject: Reply with quote

Hi AnrDaemon

Ah ok thank you, so what is the correct way to do this ?

thank you
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1399

PostPosted: Fri Nov 09, 2018 4:42 pm    Post subject: Reply with quote

Write your PHP code in your program.
Or write a proper Smarty plugin and register it to Smarty.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> General 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