mirror of
https://github.com/smarty-php/smarty.git
synced 2025-10-11 19:45:21 +02:00
Update code examples to use Smarty\Smarty and autoload instead of require_once calls and new Smarty
This commit is contained in:
@@ -50,7 +50,7 @@ parameters:
|
||||
|
||||
|
||||
<?php
|
||||
include('Smarty.class.php');
|
||||
use Smarty\Smarty;
|
||||
$smarty = new Smarty;
|
||||
|
||||
// force compilation of all config files
|
||||
|
@@ -60,7 +60,7 @@ parameters:
|
||||
|
||||
|
||||
<?php
|
||||
include('Smarty.class.php');
|
||||
use Smarty\Smarty;
|
||||
$smarty = new Smarty;
|
||||
|
||||
// force compilation of all template files
|
||||
|
@@ -30,7 +30,7 @@ be used to control which variables are seen by which templates.
|
||||
|
||||
|
||||
<?php
|
||||
include('Smarty.class.php');
|
||||
use Smarty\Smarty;
|
||||
$smarty = new Smarty;
|
||||
|
||||
// create data object with its private variable scope
|
||||
|
@@ -80,7 +80,7 @@ following parameters:
|
||||
|
||||
|
||||
<?php
|
||||
include('Smarty.class.php');
|
||||
use Smarty\Smarty;
|
||||
$smarty = new Smarty;
|
||||
|
||||
// create template object with its private variable scope
|
||||
|
@@ -30,7 +30,7 @@ PARAMETER.COMPILEID
|
||||
|
||||
|
||||
<?php
|
||||
include('Smarty.class.php');
|
||||
use Smarty\Smarty;
|
||||
$smarty = new Smarty;
|
||||
|
||||
$smarty->setCaching(true);
|
||||
|
@@ -24,6 +24,7 @@ otherwise. If security is enabled, classes registered with
|
||||
|
||||
|
||||
<?php
|
||||
use Smarty\Smarty;
|
||||
|
||||
class Bar {
|
||||
$property = "hello world";
|
||||
@@ -44,12 +45,14 @@ otherwise. If security is enabled, classes registered with
|
||||
|
||||
|
||||
<?php
|
||||
use Smarty\Smarty;
|
||||
|
||||
namespace my\php\application {
|
||||
class Bar {
|
||||
$property = "hello world";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$smarty = new Smarty();
|
||||
$smarty->registerClass("Foo", "\my\php\application\Bar");
|
||||
|
||||
|
@@ -25,7 +25,7 @@ plugin types.
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
use Smarty\Smarty;
|
||||
$smarty = new Smarty();
|
||||
$smarty->registerDefaultPluginHandler('my_plugin_handler');
|
||||
|
||||
|
@@ -14,7 +14,7 @@ installation can be accessed. It does output a corresponding protocol.
|
||||
|
||||
|
||||
<?php
|
||||
require_once('Smarty.class.php');
|
||||
use Smarty\Smarty;
|
||||
$smarty = new Smarty();
|
||||
$smarty->testInstall();
|
||||
?>
|
||||
|
Reference in New Issue
Block a user