nEdImT Posted November 7, 2008 Share Posted November 7, 2008 Hello everyone. This is my index.php file. (I am using smarty template engine). In index.php (index.html template) I have one div in which I include file (from $_GET["file"] for example: index.php?file=home.php and i include in that div home.php Index.php <?php ob_start(); session_start(); require 'libs/template.class.php'; include ("cms.php"); $a = new template(); $file = $_GET["file"]; if(empty($file)){ $file = "home.php"; } $a->assign('file', $file); $a->display('index.html'); ob_end_flush(); ?> This is my home.php <?php class content extends template{ function content(){ include "cms.php"; $lang = $_GET["lang"]; if($lang=="en"){ $this->display('en/home.html'); } elseif ($lang=="bs") { $this->display('bs/home.html'); } } } $c = new content; ?> This my template.class.php <?php require 'Smarty.class.php'; class Template extends Smarty{ var $title; var $keywords; var $description; } ?> And how can I put in those variables: title, keywords, description. To do something like $this->title = "my title"; in home.php but how to read in index.php Hope you understand me. Link to comment https://forums.phpfreaks.com/topic/131771-title-keywords-and-description-oop-if-i-use-include-in-one-div/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.