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