mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 10:54:27 +02:00
fix blunder in componentized template example
This commit is contained in:
@@ -317,17 +317,18 @@ Pretty easy isn't it?
|
|||||||
<![CDATA[
|
<![CDATA[
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
// function.load_ticker.php
|
// drop file "function.load_ticker.php" in plugin directory
|
||||||
function smarty_function_load_ticker($params, &$smarty) {
|
|
||||||
// setup our function for fetching stock data
|
|
||||||
function fetch_ticker($params['symbol']) {
|
|
||||||
// put logic here that fetches $ticker_info
|
|
||||||
// from some resource
|
|
||||||
return $ticker_info;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// setup our function for fetching stock data
|
||||||
|
function fetch_ticker($symbol) {
|
||||||
|
// put logic here that fetches $ticker_info
|
||||||
|
// from some ticker resource
|
||||||
|
return $ticker_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
function smarty_function_load_ticker($params, &$smarty) {
|
||||||
// call the function
|
// call the function
|
||||||
$ticker_info = fetch_ticker("YHOO",$ticker_info);
|
$ticker_info = fetch_ticker($params['symbol']);
|
||||||
|
|
||||||
// assign template variable
|
// assign template variable
|
||||||
$smarty->assign($params['assign'],$ticker_info);
|
$smarty->assign($params['assign'],$ticker_info);
|
||||||
|
Reference in New Issue
Block a user