smarty3

How to change the extension in view using codeigniter 3?

强颜欢笑 提交于 2020-01-03 03:18:08
问题 Here's my problem I setup Codeigniter 3 in my local and use an thirdparty (MX thing) now that I have adjusted the file path, I wanted to change the file extension that is being fetch the controller. $this->load->view('welcome_message'); I change the file in views from: welcome_message.php to this welcome_message.html Now I get this error An Error Was Encountered Unable to load the requested file: welcome_message.php but I wanted to use the .html extension becuase the folder path that I will

Smarty multidimensional Array

旧时模样 提交于 2019-12-25 10:01:14
问题 I have a multidimensional array like this : $products Smarty_Variable Object (3) ->value = Array (2) 0 => Array (73) id_product => "1" id_supplier => "1" id_manufacturer => "1" id_tax_rules_group => "1" id_category_default => "2" id_color_default => "2" on_sale => "0" online_only => "0" ean13 => "0" upc => null ecotax => "0.000000" quantity => "50" minimal_quantity => "1" price => 189.05 wholesale_price => "70.000000" unity => null unit_price_ratio => "0.000000" additional_shipping_cost => "0

Smarty: how to cache properly?

耗尽温柔 提交于 2019-12-24 00:34:40
问题 Say I have a page that contains dynamic content (e.g. search results). What is the proper caching technique? Put nocache tags around the entire page? Put nocache tags around the segment of mark up that actually contains the dynamic data? Put nocache tags around the dynamic data? Somehow tell Smarty not to cache the dynamic data? The dynamic data is assigned as a Smarty variable (e.g. via assign ). I think I need to try to maximize caching, but am struggling a bit at what needs to be cached,

Smarty kills my session

百般思念 提交于 2019-12-13 19:11:58
问题 I have a problem with Smarty 3.1.13. Smarty kills my session. Every time I refresh my page, $_SESSION array is empty. When I comment line $smarty->display('index.tpl') , everything is OK. Any ideas? 回答1: You have to start your session before $smarty->display('index.tpl') This is beacause the session cookie needs to be send in the HTTP header and therefore session_start will need to be called before the first line of output. So make sure session_start() is placed before $smarty->display('index

Prestashop: switch theme on the fly and read cookie to check param in url

我的未来我决定 提交于 2019-12-13 06:43:47
问题 In order to setup an A/B testing (through GG Analytics), I planned to duplicate my current theme (for organisations purposes) in order to use the duplicated theme to do the alternate versions of the test. I use Prestashop 1.4.9.2 . What I already did, and works: Added this to /classes/FrontController.php , in displayHeader() function (I know I should override, but not the point ;)) : if(isset($_GET['alternate'])) { $cookie->alternate = "1"; $cookie->write(); } Replaced in /config/settings.inc

shorten smarty if statements

女生的网名这么多〃 提交于 2019-12-13 01:15:54
问题 I have a smarty if statement as follows: <{if $page->getURLName() eq 'big-issues' or $page->getURLName() eq 'polls' or $page->getURLName() eq 'what-we-do' or $action eq 'events' or $action eq 'blogs' or $action eq 'news'}> I have to compare the same statements several time in the template. And its really tedious to ugly to repeat this statements several times. I know I can cache a statements and reuse it many times but I was looking if its possible to do something like this: <{if $page-

mdl-stepper javascript and HTML

做~自己de王妃 提交于 2019-12-12 02:33:06
问题 I copied and pasted the code I found here. When I try and step (press continue) it does not want to move, in fact it does nothing. I am using Smarty PHP and putting the JavaScript and CSS in the header area of the site - jQuery I am using I have that at the bottom. {literal} <link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'> <!-- style --> <style> @-webkit-keyframes FadeIn { 0% { opacity: 0; } 100% { opacity: 100; } } @-moz-keyframes FadeIn { 0% {

Using Smarty 3, Code Igniter 2, and HMVC together with smarty's inheritance?

夙愿已清 提交于 2019-12-11 15:51:02
问题 I am using Code Igniter, The HMVC library, and Smarty with this library. Smarty is working fine by default, however if I try to use smarty's inheritance feature ( {extends file="master.tpl"} ) then we run into an issue. The extends feature does not look in the module views folder for the extended file (in the above's case master.tpl ), instead it only looks in the application/views/ folder and throws an error if it cannot find it. I could add APPPATH."modules/smartytest/views" to the $config[

Error in compiling product.tpl using smarty

妖精的绣舞 提交于 2019-12-11 04:14:52
问题 I have tried to compile the this tpl file using smarty. My php file is this. But I am being shown the error message ( ! ) Fatal error: Uncaught --> Smarty Compiler: Syntax error in template ".\templates\product.tpl" on line 94 "var doesntExist = '{l s='This combination does not exist for this product. Please choose another.' js=1}';" unknown tag "l" <-- thrown in C:\wamp\www\Smarty\libs\sysplugins\smarty_internal_templatecompilerbase.php on line 94 Can anyone please help me how to fix this

How to change the extension in view using codeigniter 3?

僤鯓⒐⒋嵵緔 提交于 2019-12-07 15:32:29
Here's my problem I setup Codeigniter 3 in my local and use an thirdparty (MX thing) now that I have adjusted the file path, I wanted to change the file extension that is being fetch the controller. $this->load->view('welcome_message'); I change the file in views from: welcome_message.php to this welcome_message.html Now I get this error An Error Was Encountered Unable to load the requested file: welcome_message.php but I wanted to use the .html extension becuase the folder path that I will be using will only contain html/js/css (template folder) files only (i will separate the php files to