Search Results

Search found 173 results on 7 pages for 'smarty'.

Page 1/7 | 1 2 3 4 5 6 7  | Next Page >

  • Eval Smarty Code inside a Smarty Template

    - by clops
    Hi, is there a way to evaluate Smarty Code inside an existing Smarty template? For example, I may have the following construct: smartyTemplate.tpl <body> <div id="dynamicPart"> {$valueFromDatabase} </div> </body> Whereas the Smarty variable $valueFromDatabase contains another Smarty Template which I would like to be inserted in place of the variable and then evaluated as a template (with all the logic expressions in replacements neccessary).

    Read the article

  • Smarty: Configurable Comments and Code Templates

    - by Martin Fousek
    Hello, today we would like to show you few improvements we have prepared in PHP Smarty Framework for NetBeans 7.3. So let's talk about adjustable toggle comment action and code templates. Configurable Comments As some of you requested we implemented toggle comment action with adjustable behavior. In NetBeans 7.3 you can choose in Options between commenting as a "Smarty comments everywhere" or "Language sensitive comments" in Smarty Templates. Toggle comment language sensitive: Toggle comment as Smarty comment everywhere: Code Templates In NetBeans 7.3 we will provide by default many code templates inside Smarty templates or directly inside Smarty tags. Available should be code templates for all built-in or custom functions and modifiers of Smarty 3.x. Besides that you should be able to define additional custom templates easily in Options -> Editor -> Code Templates for "Smarty Templates" or directly for "Smarty Markup" (which means code templates inside Smarty tag). You can also take advantage of selection's template which are able to wrap your code with chosen Smarty tag. That's all for today. As always, please test it and report all the issues or enhancements you find in NetBeans BugZilla (component php, subcomponent Smarty).

    Read the article

  • How to extend the Smarty class right

    - by Evolutio
    I have a Problem with Smarty. I have made this class: <?php require_once(INCLUDE_PATH.'smarty/Smarty.class.php'); class IndexPage extends Smarty { public $templateName = 'index.tpl'; public function __construct() { parent::__construct(); $this->showTemplate(); } public function showTemplate() { self::display('index.tpl'); } } ?> But why it doesn't works? Here is the Error: Fatal error: Uncaught exception 'SmartyException' with message 'Unable to load template file 'index.tpl'' in D:\xampp\htdocs\aiondb\lib\smarty\sysplugins\smarty_internal_templatebase.php:127 Stack trace: #0 D:\xampp\htdocs\aiondb\lib\smarty\sysplugins\smarty_internal_templatebase.php(374): Smarty_Internal_TemplateBase->fetch('index.tpl', NULL, NULL, NULL, true) #1 D:\xampp\htdocs\aiondb\lib\classes\IndexPage.class.php(14): Smarty_Internal_TemplateBase->display('index.tpl') #2 D:\xampp\htdocs\aiondb\lib\classes\IndexPage.class.php(10): IndexPage->showTemplate() #3 D:\xampp\htdocs\aiondb\index.php(3): IndexPage->__construct() #4 {main} thrown in D:\xampp\htdocs\aiondb\lib\smarty\sysplugins\smarty_internal_templatebase.php on line 127

    Read the article

  • certain Smarty tags don't work in OpenX templates

    - by mikez302
    I am on a team that is developing an OpenX plugin, and I am responsible for the UI. I noticed that if I use certain Smarty tags in my template, the app doesn't work and I see an error message, similar to this: Plugin by name 'Html_select_date' was not found in the registry; used paths: default_views_helpers_: /openx/www/admin/plugins/myApp/application/modules/default/views/helpers/ OX_OXP_UI_View_Helper_: /openx/www/admin/plugins/myApp/application/../library/OX/OXP/UI/View/Helper/ OX_UI_View_Helper_: /openx/www/admin/plugins/myApp/application/../library/OX/UI/View/Helper/ Zend_View_Helper_: Zend/View/Helper/ (stack trace) The stack trace looks like this: #0 /openx/www/admin/plugins/myApp/library/Zend/View/Abstract.php(1117): Zend_Loader_PluginLoader-load('Html_select_dat...') #1 /openx/www/admin/plugins/myApp/library/Zend/View/Abstract.php(568): Zend_View_Abstract-_getPlugin('helper', 'html_select_dat...') #2 /openx/www/admin/plugins/myApp/library/OX/UI/Smarty/SmartyWithViewHelper.php(25): Zend_View_Abstract-getHelper('html_select_dat...') #3 /openx/var/templates_compiled/%2Fdefault%2Fviews%2Fscripts%2Findex%2Fview-reports.html^%%E8^E80^E80B56F2%%view-reports.html.php(38): OX_UI_Smarty_SmartyWithViewHelper-callViewHelper('html_select_dat...', Array) #4 /openx/lib/smarty/Smarty.class.php(1274): include('/openx...') #5 /openx/www/admin/plugins/myApp/library/OX/UI/View/SmartyView.php(103): Smarty-fetch('/openx...') #6 /openx/www/admin/plugins/myApp/library/Zend/View/Abstract.php(832): OX_UI_View_SmartyView-_run('/openx...') #7 /openx/www/admin/plugins/myApp/library/OX/UI/View/SmartyView.php(151): Zend_View_Abstract-render('index/view-repo...') #8 /openx/www/admin/plugins/myApp/library/OX/UI/View/Helper/WithViewScript.php(23): OX_UI_View_SmartyView-render('index/view-repo...') #9 /openx/www/admin/plugins/myApp/application/modules/default/views/helpers/ViewReports.php(5): OX_UI_View_Helper_WithViewScript::renderViewScript('index/view-repo...', Array) #10 /openx/www/admin/plugins/myApp/application/modules/default/controllers/IndexController.php(98): Default_Views_Helpers_ViewReports-renderPage() #11 /openx/www/admin/plugins/myApp/library/Zend/Controller/Action.php(512): IndexController-viewReportsAction() #12 /openx/www/admin/plugins/myApp/library/Zend/Controller/Dispatcher/Standard.php(288): Zend_Controller_Action-dispatch('viewReportsActi...') #13 /openx/www/admin/plugins/myApp/library/Zend/Controller/Front.php(945): Zend_Controller_Dispatcher_Standard-dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #14 /openx/www/admin/plugins/myApp/application/bootstrap.php(117): Zend_Controller_Front-dispatch() #15 /openx/www/admin/plugins/myApp/public/index.php(7): require('/openx...') #16 {main} This does not happen with all Smarty tags. For example, I can use {if}, {foreach}, or {assign} tags without any problems. But whenever I try to use {html_select_date}, {html_image}, or {html_table}, I get the errors. In case this matters, the programmer who is designing the plugin copied the openXWorkflow plugin and made some changes. I noticed that the openXWorkflow plugin has a file (openx/plugins_repo/openXWorkflow/www/admin/plugins/openXWorkflow/library/OX/UI/Smarty/SmartyCompilerWithViewHelper.php) with a class that overrides the default Smarty compiler, supposedly with the ability to compile shorthands for calling ZF view helpers. That file has a list of Smarty functions, but the list is incomplete. If I add the functions to the list, or simply delete the file, my template works fine, but I don't like to change library files. It may make the app hard to maintain, and I don't know if it will mess up something else. The file has the comment "There is no easy access to the list of Smarty's built-in functions so we need to list them here. HTML-specific functions are not included as we cover HTML generation separately.", so it seems like certain Smarty functions may be disabled on purpose for some reason. Will anything bad happen if I try to use them? If, for example, I want to use the {html_select_date} tag in my template, how would I go about doing that? Keep in mind that much of this stuff is new and unfamiliar to me. This is my first time ever using OpenX or Smarty, and I only have a little bit of experience with the Zend framework. Please let me know if we are using the wrong approach.

    Read the article

  • smarty path problem

    - by ruru
    here is my folder index.php smartyhere -Smarty.class.php admin -index.php -users.php in index.php - $smarty-display('index.tpl'); in admin/index.php - $smarty-display('adminindex.tpl'); got error Smarty error: unable to read resource: "adminindex.tpl" any idea ? thx

    Read the article

  • CakePHP Smarty View with theming support (i.e. Themed Smarty View)

    - by Balchev
    Hi folks, I use Smarty View, but want to benefit from theme options. Since for theming cake use Theme View, I cant use both Smarty and Theme at the same time. Perhaps can combine the code but am not that familar with View eingine core. Already have a lot views done with smarty and do not want to recreate all of them with plain php. Is there a ready combined solution i.e. Themed Smarty View? Thanks

    Read the article

  • How to check a complex condition in Smarty(PHP)

    - by php html
    I need to display a section or another in a smarty template. My condition is simple: if a smarty value starts with a string I should display one section, otherwise the other smarty section should be displayed. I can change only the tpl files. {php} if (substr($url,0,4) != 'http') { {/php} section 1 {php} } else { {/php} section 2 {php} } {/php} The problem is that I can not read the url varible which was previously assigned using $smarty-assign. Basically, I'm looking for the smarty function that can be used to retrieve a value, or if there is a better solution.

    Read the article

  • how to assign an object to smarty templates?

    - by keisimone
    i created a model object in PHP class User { public $title; public function changeTitle($newTitle){ $this->title = $newTitle; } } How do i expose the property of a User object in smarty just by assigning the object? I know i can do this $smarty->assign('title', $user->title); but my object has something like over 20 plus properties. Please advise. EDIT 1 the following didn't work for me. $smarty->assign('user', $user); OR $smarty->register_object('user', $user); then i try to {$user->title} nothing came out. Thank you.

    Read the article

  • advantage and disadvantage of smarty template

    - by Bharanikumar
    Hi , New to smarty , Why people's showing interest in framework , What are the advantages in that , also lot of people little bit avoiding template what is the reason , What is the real reason people choosing the smarty , How much really smarty best for web development , Regards Bharanikumar

    Read the article

  • Smarty - foreach loop 4 times and create a new list

    - by Harold
    I want to achieve a list like this with smarty. <ul> <li> <a>img1</a> <a>img2</a> <a>img3</a> <a>img4</a> </li> <li> <a>img5</a> <a>img6</a> <a>img7</a> <a>img8</a> </li> <li> <a>img9</a> <a>img10</a> <a>img11</a> <a>img12</a> </li> </ul> Using this sample code <ul class="bullet"> {foreach from=$manufacturers item=manufacturer name=manufacturer_list} {if $smarty.foreach.manufacturer_list.index < 4} <li class="{if $smarty.foreach.manufacturer_list.last}last_item{elseif $smarty.foreach.manufacturer_list.first}first_item{else}item{/if}"> <a href="{$link->getmanufacturerLink($manufacturer.id_manufacturer, $manufacturer.link_rewrite)}" title="{l s='More about' mod='blockmanufacturer'}{$manufacturer.name}"> <img src="{$img_manu_dir}{$manufacturer.id_manufacturer}.jpg"><span>{$manufacturer.name}<span></a> </li> {/if} {/foreach} First with given array $manufacturers it will loop inside a <li> max of 4 times and will create 4 <img>. And then, when it reach the 4th index, it will make a new <li> tag. Thanks for the help!

    Read the article

  • Smarty debug mode not displaying included templates.

    - by Kyle Sevenoaks
    On www.euroworker.no/order I have set Smarty's debug mode on with {debug output=html} in the header, so it will debug every page. But it says: Smarty Debug Console included templates & config files (load time in seconds): no templates included And after a list of template variables, {$cart} Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 561962 bytes) in /home/euroworkerno/www/library/smarty/libs/plugins/modifier.debug_print_var.php on line 30 It also doesn't display a list of templates for any url.. This is strange, can anyone point me to why it won't display the lit of .tpls? I need to find some HTML comments that someone has left in to rid IE of a display bug. Thanks.

    Read the article

  • How can I increment a Smarty variable?

    - by alex
    I am not usually a Smarty guy, so I'm a bit stuck. I want to echo the index of an array, but I want to increment it each time I echo it. This is what I have... <ul> {foreach from=$gallery key=index item=image} <li> <img src="{$image}" alt="" id="panel-{$index++}" /> </li> {/foreach} </ul> It doesn't work. Is the best way to do this to pre-process the array before handing it to Smarty? Is there a way I can do this using Smarty?

    Read the article

  • Using str_replace with smarty variable

    - by zx
    Hello, Basically I just want to strip out a part of my smarty variable contents. {foreach from=$_sequences key=k item=v} {if $v.pri == $smarty.get.cf && $v.type == 'TTS'} {$v.data} {/if} {/foreach} {$v.data} will echo out 21,5555555555 I want it to only echo out 5555555555. I tried str_replace but couldn't get it working.. str_replace('"','',${v.data});// - doesn't work str_replace('"','',$v.data);// - doesn't work What would be the best way I can accomplish this?

    Read the article

  • THE FASTEST Smarty Cache Handler

    - by rob.effect
    Does anyone know if there is an overview of the performance of different cache handlers for smarty? I compared smarty file cache with a memcache handler, but it seemed memcache has a negative impact on performance. I figured there would be a faster way to cache than through the filesystem... am I wrong?

    Read the article

  • Understanding Smarty and MVC Frameworks

    - by Korrupzion
    Hello there, I just created this thread to discuss with people who have adopted the smarty system, and how many time it took to you to understand it, because i just can't get the idea, instead of making every easier as everybody says i think it just make more complex to code. More than a problem with only smarty is with the whole MVC model, with CakePHP or KohanaPHP i experience the same problems, u need to do 3x lines of code and files for something that u can do with a few lines of simple php. Maybe u can tell how did u learned to code using MVC model :)

    Read the article

  • defining arrays in smarty via config files

    - by quardas
    Is it possible to defining arrays in config files in smarty?? for example I want have small data base in config file (located in /configs) - few (about 20) products descriptions: title, price, description. After that I want to list it via foreach or section. How can I define that array in Smarty without MySql or other db engine. Can I do that?

    Read the article

  • Tell smarty to print block as is

    - by Juriy
    Hello guys, I need to inline some javascript code into the Smarty template files and these {ldelim} {rdelim} things are killing me. Is there a way to tell smarty to ignore the markup for a block and just output it as is? Something similar to CDATA blocks in the xml? Just in case: here is how simple javascript looks now: $(function() {ldelim} $( "#slides" ).accessNews({ldelim} speed : "{$speed}", slideBy : 1 {rdelim}); {rdelim}); creepy heh?

    Read the article

  • Smarty: including a template file from the same directory

    - by Robert Munteanu
    I have a Smarty template located in a directory under templates_dir: templates/some/dir/template.tpl . In the same directory, I have a sub-template: templates/some/dir/_component.tpl . I can't include the sub-component using an unqualified include, since apparently it looks it up under the templates_dir: {include file='_component.tpl'} How can I tell Smarty to read the file from the same directory, as opposed to the templates root ? I do not want to specify absolute paths, since it will cause problems when changing directory structures.

    Read the article

1 2 3 4 5 6 7  | Next Page >