Smarty 3 and {php} (General)

by edkgb, Monday, September 12, 2011, 08:35 (4631 days ago) @ Peter

INCLUDE_PHP was deprecated in Smarty, and I had the same issue. Try this:

Put this near the bottom of index.php

## Your code
$navbar = file_get_contents($_SERVER['DOCUMENT_ROOT'].'/public/includes/navbar.inc');
$smarty -> assign ('navbar', $navbar);
 
## Existing code
$smarty->display($theme.'/'.$template); 
?>

Then stick

{$navbar}

in the tpl file(s).

Hi Peter,
Many thanks for your reply, Yes it works perfectly you are 'The Man'.
I hate using depreciated terms but although I'm ok with PHP Smarty is a mystery to me.
I guess there must be many more users of MLF, that are having a similar problem, your solution is going to help them.
With grateful thanks once again.
Eddie


Complete thread:

 RSS Feed of thread