|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
vuongminh1380 Smarty n00b
Joined: 25 Mar 2016 Posts: 2
|
Posted: Fri Mar 25, 2016 7:50 am Post subject: How to use literal tag in my plugin function block |
|
|
I need to disable smarty code when user call my plugin block like literal tag on my block function
Code: |
<?php
function smarty_block_testd($params, $content, $template, &$repeat){
if ($content === null) { // open tag
$template->beginLiteral(); // method i want
}else{ // close tag
$template->endLiteral(); // method i want
}
}
?>
|
Thank you for reading |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Fri Mar 25, 2016 12:22 pm Post subject: |
|
|
Policies like this one enforced with compile-time filters and/or different template delimiters for system and user templates. |
|
Back to top |
|
vuongminh1380 Smarty n00b
Joined: 25 Mar 2016 Posts: 2
|
Posted: Fri Mar 25, 2016 2:56 pm Post subject: |
|
|
AnrDaemon wrote: | Policies like this one enforced with compile-time filters and/or different template delimiters for system and user templates. |
Thank for help bro!
I need it to write my plugin ProductList bro! My idea:
Code: | {ProductList} // it loop product items
{$pro_name}
{$pro_price}
{if $had_tag}
{ProductTag proid=$pro_id}
{/ProductTag}
{/if}
{/ProductList} |
I need disable smarty code in ProductList tag and get content to do:
Code: | foreach($product_list as $item){
$template->assignGlobal("pro_name", $item["pro_name"]);
$template->display("string: $content);
}
|
|
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|