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[ <![CDATA[
<?php <?php
// function.load_ticker.php // drop file "function.load_ticker.php" in plugin directory
function smarty_function_load_ticker($params, &amp;$smarty) {
// setup our function for fetching stock data // setup our function for fetching stock data
function fetch_ticker($params['symbol']) { function fetch_ticker($symbol) {
// put logic here that fetches $ticker_info // put logic here that fetches $ticker_info
// from some resource // from some ticker resource
return $ticker_info; return $ticker_info;
} }
function smarty_function_load_ticker($params, &amp;$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);