[ _CaRtMan_ @ 18.10.2008. 22:26 ] @
Zdravo. Imam problem. Kod ide ovako:

index.php

Code:

<?php
ob_start();

include ("config.php");
$a = new Template();

    
    $file = $_GET["file"];
    $a->assign('file', $file);
    $a->display('index.html');
    
ob_end_flush();
?> 

home.php

Code:

<?php
class content extends template{

    function content(){
     
    $this->title = "title sajta";
    $this->desc = "Opis stranice";
    $this->keywords= "ovdje idu kljucne, rijeci, bla bla, nemam pojma, svasta nesto ide ovdje";
    
    
    $this->assign('title', $this->title);
    $this->assign('desc', $this->desc);
    $this->assign('keywords', $this->keywords);
    
    $this->display('nest.html');
    
    }
    
}

$c = new content;
?> 

i sad kad upisem u nest.html {$title} on ispise, ali kako bih da upisem u index.html a da on ispise onaj sto je u ?file=nesto.php , home.php itd. Ovisno koji je file otvoren...

??

Edit:DakiPro: Koristi [ code ] tagove!

[Ovu poruku je menjao dakipro dana 19.10.2008. u 12:53 GMT+1]
[ dakipro @ 19.10.2008. 11:56 ] @
ako Template() ima neke veze sa smartijem, onda assign_by_ref(); ako ne, onda vidi kako to radi, pa tako i ti :)
Ili te vrednosti za title stavi na kraj kod, pred sam ->display() pa prosledi promenjivu iz ostalih fajlova.
[ _CaRtMan_ @ 19.10.2008. 14:58 ] @
u home.php da stavim vrijednosti pred display??

<?php
class content extends template{

function content(){



$this->assign('title', $this->title);
$this->assign('desc', $this->desc);
$this->assign('keywords', $this->keywords);

$this->title = "title sajta";
$this->desc = "Opis stranice";
$this->keywords= "ovdje idu kljucne, rijeci, bla bla, nemam pojma, svasta nesto ide ovdje";

$this->display('nest.html');

}

}

$c = new content;
?>


kakva je razlika?? hehe ne znam sta mislis ? a pogledacu ovo assign_by_ref
[ _CaRtMan_ @ 06.11.2008. 21:17 ] @
IMa li koga?