diff options
| author | Uwe.Tews <uwe.tews@localhost> | 2009-09-30 22:03:41 +0000 |
|---|---|---|
| committer | Uwe.Tews <uwe.tews@localhost> | 2009-09-30 22:03:41 +0000 |
| commit | 898819dd2b4969a9b4b4b25ef5d5d1f33498f9a4 (patch) | |
| tree | e847ad290d6ac1bb34f31286bdc446d610a8d1bc /demo | |
| parent | 25d4535be6ec81b4d8e5a6146b7e76b5c5bc1777 (diff) | |
| download | smarty-898819dd2b4969a9b4b4b25ef5d5d1f33498f9a4.tar.gz smarty-898819dd2b4969a9b4b4b25ef5d5d1f33498f9a4.tar.bz2 smarty-898819dd2b4969a9b4b4b25ef5d5d1f33498f9a4.zip | |
- reactivated PHP resource for simple PHP templates. Must set allow_php_templates = true to enable
- {PHP} tag can be enabled by allow_php_tag = true
Diffstat (limited to 'demo')
| -rw-r--r-- | demo/index.php | 8 | ||||
| -rw-r--r-- | demo/index_php_template.php | 9 | ||||
| -rw-r--r-- | demo/templates/index_view.php | 16 |
3 files changed, 17 insertions, 16 deletions
diff --git a/demo/index.php b/demo/index.php index 0da1b9d8..8bada438 100644 --- a/demo/index.php +++ b/demo/index.php @@ -6,13 +6,11 @@ $smarty = new Smarty; //$smarty->force_compile = true;
-//$smarty->debugging = true;
+$smarty->debugging = true;
$smarty->caching = true;
-$smarty->caching_lifetime = 120;
+$smarty->cache_lifetime = 120;
-
-
-$smarty->assign("Name","Fred Irving Johnathan Bradley Peppergill");
+$smarty->assign("Name","Fred Irving Johnathan Bradley Peppergill",true);
$smarty->assign("FirstName",array("John","Mary","James","Henry"));
$smarty->assign("LastName",array("Doe","Smith","Johnson","Case"));
$smarty->assign("Class",array(array("A","B","C","D"), array("E", "F", "G", "H"),
diff --git a/demo/index_php_template.php b/demo/index_php_template.php index f7971ea5..2f95bf67 100644 --- a/demo/index_php_template.php +++ b/demo/index_php_template.php @@ -5,7 +5,6 @@ * @package SmartyTestScripts */ require('../libs/Smarty.class.php'); -ini_set('short_open_tag','1'); class Person { @@ -31,11 +30,13 @@ ini_set('short_open_tag','1'); } $smarty = new Smarty(); +$smarty->allow_php_templates= true; $smarty->force_compile = false; -$smarty->caching = false; -$smarty->cache_lifetime = 10; +$smarty->caching = true; +$smarty->cache_lifetime = 100; +//$smarty->debugging = true; -$smarty->assign('foo','<bar>'); +$smarty->assign('foo',"'bar'"); $person = new Person; diff --git a/demo/templates/index_view.php b/demo/templates/index_view.php index ad760aa1..833fe961 100644 --- a/demo/templates/index_view.php +++ b/demo/templates/index_view.php @@ -1,11 +1,13 @@ PHP file test $foo is <?=$foo?> -<br> Test modifier chaining -<?=$foo->trim()->escape('html')?> +<br> Test functions +<? echo trim($foo,"'");?> <br>Test objects -<?=$person->setName('Paul')->setAge(39)->introduce()->trim()->truncate(10)?> +<?=$person->setName('Paul')->setAge(39)->introduce()?> <br>Test Arrays -<?=$array['a']['aa']->truncate(5)?><?=$array['b']?> -<br>Function -<?=$_f->trim($array['a']['aa'])->truncate(10)?> -DONE +<?=$array['a']['aa']?> <?=$array['b']?> +<br>function time +<? echo time();?> +<br>nocache function time +<? echo '<? echo time();?>';?> +<br>DONE |
