mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
- PHPdoc updates
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
- improve inheritance code
|
- improve inheritance code
|
||||||
- update external methods
|
- update external methods
|
||||||
- code fixes
|
- code fixes
|
||||||
|
- PHPdoc updates
|
||||||
|
|
||||||
25.12.2015
|
25.12.2015
|
||||||
- compile {block} tag code and its processing into classes
|
- compile {block} tag code and its processing into classes
|
||||||
|
@@ -121,7 +121,7 @@ class Smarty extends Smarty_Internal_TemplateBase
|
|||||||
/**
|
/**
|
||||||
* smarty version
|
* smarty version
|
||||||
*/
|
*/
|
||||||
const SMARTY_VERSION = '3.1.30-dev/10';
|
const SMARTY_VERSION = '3.1.30-dev/11';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* define variable scopes
|
* define variable scopes
|
||||||
|
@@ -21,9 +21,10 @@ class Smarty_Internal_Compile_Rdelim extends Smarty_Internal_CompileBase
|
|||||||
* This tag does output the right delimiter.
|
* This tag does output the right delimiter.
|
||||||
*
|
*
|
||||||
* @param array $args array with attributes from parser
|
* @param array $args array with attributes from parser
|
||||||
* @param object $compiler compiler object
|
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
|
||||||
*
|
*
|
||||||
* @return string compiled code
|
* @return string compiled code
|
||||||
|
* @throws \SmartyCompilerException
|
||||||
*/
|
*/
|
||||||
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
|
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
|
||||||
{
|
{
|
||||||
|
@@ -20,7 +20,7 @@ class Smarty_Internal_Compile_Setfilter extends Smarty_Internal_CompileBase
|
|||||||
* Compiles code for setfilter tag
|
* Compiles code for setfilter tag
|
||||||
*
|
*
|
||||||
* @param array $args array with attributes from parser
|
* @param array $args array with attributes from parser
|
||||||
* @param object $compiler compiler object
|
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
|
||||||
* @param array $parameter array with compilation parameter
|
* @param array $parameter array with compilation parameter
|
||||||
*
|
*
|
||||||
* @return string compiled code
|
* @return string compiled code
|
||||||
@@ -49,7 +49,7 @@ class Smarty_Internal_Compile_Setfilterclose extends Smarty_Internal_CompileBase
|
|||||||
* This tag does not generate compiled output. It resets variable filter.
|
* This tag does not generate compiled output. It resets variable filter.
|
||||||
*
|
*
|
||||||
* @param array $args array with attributes from parser
|
* @param array $args array with attributes from parser
|
||||||
* @param object $compiler compiler object
|
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
|
||||||
*
|
*
|
||||||
* @return string compiled code
|
* @return string compiled code
|
||||||
*/
|
*/
|
||||||
|
@@ -22,7 +22,8 @@ class Smarty_Internal_Method_GetGlobal
|
|||||||
* Returns a single or all global variables
|
* Returns a single or all global variables
|
||||||
*
|
*
|
||||||
* @api Smarty::getGlobal()
|
* @api Smarty::getGlobal()
|
||||||
|
*
|
||||||
|
* @param \Smarty_Internal_Data $data
|
||||||
* @param string $varName variable name or null
|
* @param string $varName variable name or null
|
||||||
*
|
*
|
||||||
* @return string variable value or or array of variables
|
* @return string variable value or or array of variables
|
||||||
|
@@ -25,7 +25,7 @@ class Smarty_Internal_Method_UnregisterCacheResource
|
|||||||
* @link http://www.smarty.net/docs/en/api.unregister.cacheresource.tpl
|
* @link http://www.smarty.net/docs/en/api.unregister.cacheresource.tpl
|
||||||
*
|
*
|
||||||
* @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj
|
* @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj
|
||||||
* @param string $type name of cache resource type
|
* @param $name
|
||||||
*
|
*
|
||||||
* @return \Smarty|\Smarty_Internal_Template
|
* @return \Smarty|\Smarty_Internal_Template
|
||||||
*/
|
*/
|
||||||
|
@@ -13,7 +13,8 @@ class Smarty_Internal_Runtime_CacheModify
|
|||||||
/**
|
/**
|
||||||
* check client side cache
|
* check client side cache
|
||||||
*
|
*
|
||||||
* @param Smarty_Internal_Template $_template
|
* @param \Smarty_Template_Cached $cached
|
||||||
|
* @param \Smarty_Internal_Template $_template
|
||||||
* @param string $content
|
* @param string $content
|
||||||
*/
|
*/
|
||||||
public function cacheModifiedCheck(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template, $content)
|
public function cacheModifiedCheck(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template, $content)
|
||||||
|
@@ -144,6 +144,7 @@ class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCom
|
|||||||
* @param array $parameter optional parameter array
|
* @param array $parameter optional parameter array
|
||||||
* @param string $key optional key for callback
|
* @param string $key optional key for callback
|
||||||
* @param bool $replace if true replace existing keyed callback
|
* @param bool $replace if true replace existing keyed callback
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
public function registerPostCompileCallback($callback, $parameter = array(), $key = null, $replace = false)
|
public function registerPostCompileCallback($callback, $parameter = array(), $key = null, $replace = false)
|
||||||
{
|
{
|
||||||
|
@@ -119,13 +119,11 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
|
|||||||
/**
|
/**
|
||||||
* render template
|
* render template
|
||||||
*
|
*
|
||||||
* @param bool $merge_tpl_vars if true parent template variables merged in to local scope
|
|
||||||
* @param bool $no_output_filter if true do not run output filter
|
* @param bool $no_output_filter if true do not run output filter
|
||||||
* @param bool $display true: display, false: fetch null: subtemplate
|
* @param null|bool $display true: display, false: fetch null: sub-template
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @return string
|
||||||
* @throws SmartyException
|
* @throws \SmartyException
|
||||||
* @return string rendered template output
|
|
||||||
*/
|
*/
|
||||||
public function render($no_output_filter = true, $display = null)
|
public function render($no_output_filter = true, $display = null)
|
||||||
{
|
{
|
||||||
@@ -166,7 +164,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
|
|||||||
// display or fetch
|
// display or fetch
|
||||||
if ($display) {
|
if ($display) {
|
||||||
if ($this->caching && $this->smarty->cache_modified_check) {
|
if ($this->caching && $this->smarty->cache_modified_check) {
|
||||||
$this->smarty->ext->_cachemodify->cacheModifiedCheck($this->cached, $this,
|
$this->smarty->ext->_cacheModify->cacheModifiedCheck($this->cached, $this,
|
||||||
isset($content) ? $content : ob_get_clean());
|
isset($content) ? $content : ob_get_clean());
|
||||||
} else {
|
} else {
|
||||||
if ((!$this->caching || $this->cached->has_nocache_code || $this->source->handler->recompiled) &&
|
if ((!$this->caching || $this->cached->has_nocache_code || $this->source->handler->recompiled) &&
|
||||||
@@ -264,9 +262,6 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
|
|||||||
$tpl->cache_id = $cache_id;
|
$tpl->cache_id = $cache_id;
|
||||||
$tpl->compile_id = $compile_id;
|
$tpl->compile_id = $compile_id;
|
||||||
if (isset($uid)) {
|
if (isset($uid)) {
|
||||||
if (isset($tpl->compiled)) {
|
|
||||||
$tpl->compiled->isInit = false;
|
|
||||||
}
|
|
||||||
// for inline templates we can get all resource information from file dependency
|
// for inline templates we can get all resource information from file dependency
|
||||||
if (isset($tpl->compiled->file_dependency[ $uid ])) {
|
if (isset($tpl->compiled->file_dependency[ $uid ])) {
|
||||||
list($filepath, $timestamp, $type) = $tpl->compiled->file_dependency[ $uid ];
|
list($filepath, $timestamp, $type) = $tpl->compiled->file_dependency[ $uid ];
|
||||||
@@ -403,10 +398,12 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
|
|||||||
* - Decode saved properties from compiled template and cache files
|
* - Decode saved properties from compiled template and cache files
|
||||||
* - Check if compiled or cache file is valid
|
* - Check if compiled or cache file is valid
|
||||||
*
|
*
|
||||||
|
* @param \Smarty_Internal_Template $tpl
|
||||||
* @param array $properties special template properties
|
* @param array $properties special template properties
|
||||||
* @param bool $cache flag if called from cache file
|
* @param bool $cache flag if called from cache file
|
||||||
*
|
*
|
||||||
* @return bool flag if compiled or cache file is valid
|
* @return bool flag if compiled or cache file is valid
|
||||||
|
* @throws \SmartyException
|
||||||
*/
|
*/
|
||||||
public function _decodeProperties(Smarty_Internal_Template $tpl, $properties, $cache = false)
|
public function _decodeProperties(Smarty_Internal_Template $tpl, $properties, $cache = false)
|
||||||
{
|
{
|
||||||
|
@@ -17,8 +17,8 @@
|
|||||||
*
|
*
|
||||||
* @property Smarty_Internal_SmartyTemplateCompiler $prefixCompiledCode = ''
|
* @property Smarty_Internal_SmartyTemplateCompiler $prefixCompiledCode = ''
|
||||||
* @property Smarty_Internal_SmartyTemplateCompiler $postfixCompiledCode = ''
|
* @property Smarty_Internal_SmartyTemplateCompiler $postfixCompiledCode = ''
|
||||||
* @method Smarty_Internal_SmartyTemplateCompiler registerPostCompileCallback($callback, $parameter = array(), $key = null, $replace = false)
|
* @method registerPostCompileCallback($callback, $parameter = array(), $key = null, $replace = false)
|
||||||
* @method Smarty_Internal_SmartyTemplateCompiler unregisterPostCompileCallback($key)
|
* @method unregisterPostCompileCallback($key)
|
||||||
*/
|
*/
|
||||||
abstract class Smarty_Internal_TemplateCompilerBase
|
abstract class Smarty_Internal_TemplateCompilerBase
|
||||||
{
|
{
|
||||||
|
@@ -20,6 +20,7 @@ class Smarty_Internal_TestInstall
|
|||||||
* diagnose Smarty setup
|
* diagnose Smarty setup
|
||||||
* If $errors is secified, the diagnostic report will be appended to the array, rather than being output.
|
* If $errors is secified, the diagnostic report will be appended to the array, rather than being output.
|
||||||
*
|
*
|
||||||
|
* @param \Smarty $smarty
|
||||||
* @param array $errors array to push results into rather than outputting them
|
* @param array $errors array to push results into rather than outputting them
|
||||||
*
|
*
|
||||||
* @return bool status, true if everything is fine, false else
|
* @return bool status, true if everything is fine, false else
|
||||||
|
@@ -17,12 +17,13 @@ class Smarty_Internal_Undefined
|
|||||||
* - Decode saved properties from compiled template and cache files
|
* - Decode saved properties from compiled template and cache files
|
||||||
* - Check if compiled or cache file is valid
|
* - Check if compiled or cache file is valid
|
||||||
*
|
*
|
||||||
|
* @param \Smarty_Internal_Template $tpl
|
||||||
* @param array $properties special template properties
|
* @param array $properties special template properties
|
||||||
* @param bool $cache flag if called from cache file
|
* @param bool $cache flag if called from cache file
|
||||||
*
|
*
|
||||||
* @return bool flag if compiled or cache file is valid
|
* @return bool flag if compiled or cache file is valid
|
||||||
*/
|
*/
|
||||||
public function decodeProperties($tpl, $properties, $cache = false)
|
public function decodeProperties(Smarty_Internal_Template $tpl, $properties, $cache = false)
|
||||||
{
|
{
|
||||||
if ($cache) {
|
if ($cache) {
|
||||||
$tpl->cached->valid = false;
|
$tpl->cached->valid = false;
|
||||||
|
@@ -96,6 +96,7 @@ abstract class Smarty_Template_Resource_Base
|
|||||||
/**
|
/**
|
||||||
* get rendered template content by calling compiled or cached template code
|
* get rendered template content by calling compiled or cached template code
|
||||||
*
|
*
|
||||||
|
* @param \Smarty_Internal_Template $_template
|
||||||
* @param string $unifunc function with template code
|
* @param string $unifunc function with template code
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
|
Reference in New Issue
Block a user