fix blunder in componentized template example

This commit is contained in:
mohrt
2004-03-23 22:25:51 +00:00
parent 0c27112edf
commit 2f9adcb33c

View File

@@ -317,17 +317,18 @@ Pretty easy isn't it?
<![CDATA[
<?php
// function.load_ticker.php
function smarty_function_load_ticker($params, &amp;$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, &amp;$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);