Murls Murls
 
   تنصيب سمارتي موسع Extended Setup

طريقة تنصيب سمارتي صنف موسع


 



// استدعاء مكتبة سمارتي

require('Smarty.class.php');







//نقوم بتوسيع الصنف

class Smarty_GuestBook extends Smarty {



&
nbsp;  function Smarty_GuestBook()

&
nbsp;  {



&
nbsp;       // تشغيل الباني.

        



&
nbsp;       $this->Smarty();



&
nbsp;       $this->template_dir = '/web/www.example.com/guestbook/templates/';//تحديد مكان التمبلت

        $this->compile_dir  = '/web/www.example.com/guestbook/templates_c/';//تحديد مكان الخرج

        $this->config_dir   = '/web/www.example.com/guestbook/configs/';

&
nbsp;       $this->cache_dir    = '/web/www.example.com/guestbook/cache/';// تحديد الكاش



        $this->caching = true;// تشغيل الكاش

        $this->assign('title', 'Guest Book');// اسناد المتغير

   }



}



 
بعد ان قمنا بتوسيع الصنف
نقوم الان باستدعاءه
ملف index.php

 



require('guestbook/setup.php');//استدعاء الصنف الموسع



$smarty = new Smarty_GuestBook();// تشغيل الباني



$smarty->assign('name','Ned');//اسناد متغير



$smarty->display('index.tpl');




حرر في تاريخ 2009/08/04 الساعة 03:04:26
يرجى ضبط الكود الاول

شكرا لك
محمد سعدة في 2009/12/18 الساعة 10:12:57 مساء
require('Smarty.class.php');

classSmarty_GuestBookextendsSmarty{

functionSmarty_GuestBook()

{


$this->Smarty();



$this->template_dir='/web/www.example.com/guestbook/templates/';

$this->compile_dir='/web/www.example.com/guestbook/templates_c/';

$this->config_dir='/web/www.example.com/guestbook/configs/';

$this->cache_dir='/web/www.example.com/guestbook/cache/';



$this->caching=true;

$this->assign('title','GuestBook');

}



}
محمد سعدة في 2009/12/18 الساعة 10:12:14 مساء
شكرا جزيلا بارك الله فيك
almhajer في 2009/12/19 الساعة 09:12:11 صباحا