Jump to content

Title, keywords and description & OOP. If i use include in one div.


nEdImT

Recommended Posts

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.