Get Smarty

Donate

Donate Bitcoin Bitcoin
Paypal

Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Sites Using Smarty

Buy cheap eyeglasses from Cheapglasses123.com and save up to 80%.

Buy prescription glasses from www.australiaglasses.com and save.

Cheap Glasses Now On Sale at GlassesPeople.com. Starts At $7.95.

Where to buy discount wedding dresses and cheap smart dresses free shipping - Weddingdresstrend.com

Brautkleider auf Topwedding.de

Find free files to download on allwhatyouwant.net

Looking For Affordable Wedding Dresses 2015 at Best Prices On TDBridal.com

Shop high quality cheap prom dresses on Dresswe.co.uk

Buy New Arrival Cheap Prom Dresses 2015 at JDBRIDAL Prom Dress Store

Advertisement

Name

createTemplate() 鈥 鍒涘缓妯℃澘瀵硅薄

璇存槑

Smarty_Internal_Template聽createTemplate(string聽template,
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽object聽parent);

Smarty_Internal_Template聽createTemplate(string聽template,
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽array聽data);

Smarty_Internal_Template聽createTemplate(string聽template,
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽string聽cache_id,
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽string聽compile_id,
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽object聽parent);

Smarty_Internal_Template聽createTemplate(string聽template,
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽string聽cache_id,
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽string聽compile_id,
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽array聽data);

鍒涘缓涓涓ā鏉垮璞★紝鍙互璁display鎴栬fetch鏉ヤ娇鐢ㄣ 鍙傛暟濡備笅锛

  • template蹇呴』鏄 妯℃澘璧勬簮绫诲瀷鍜岃矾寰勩

  • cache_id is an optional parameter. You can also set the $cache_id variable once instead of passing this to each call to this function. It is used in the event that you want to cache different content of the same template, such as pages for displaying different products. See also the caching section for more information.

  • compile_id is an optional parameter. You can also set the $compile_id variable once instead of passing this to each call to this function. It is used in the event that you want to compile different versions of the same template, such as having separate templates compiled for different languages.

  • parent is an optional parameter. It is an uplink to the main Smarty object, a user-created data object or to another user-created template object. These objects can be chained. The template can access only variables assigned to any of the objects in the parent chain.

  • data is an optional parameter. It is an associative array containing the name/value pairs of variables which get assigned to the object.

Example聽14.18.聽createTemplate()


<?php
include('Smarty.class.php');
$smarty = new Smarty;

// 鍒涘缓妯℃澘瀵硅薄
$tpl = $smarty->createTemplate('index.tpl');

// 璧嬪
$tpl->assign('foo','bar');

// 鏄剧ず妯℃澘
$tpl->display();
?>

    


鍙傝 display(), 鍜 templateExists().

Comments
No comments for this page.
Post a Comment
All comments are moderated. Support questions are ignored, use the forums instead.
Author:
Email: (not shown)
What is 18 plus 18? (Are you human?)

Advertisement