Questions tagged [smarty3]

Smarty is a template engine for PHP. It enables programmers and web-designers to implement the MVC architecture pattern. The templates created can be re-used very easily.

Smarty3 is the most up-to-date branch of Smarty template engine. It requires PHP 5.2+

Last Smarty3 version is 3.1.31 and was released on Dec 14, 2016

Links

373 questions
0
votes
1 answer

Safe to Smarty {include} without file attribute?

For example, {include 'path/to/template.tpl'}? There's no mention in the documentation of said format, but it seems to work identically to: {include file='path/to/template.tpl'} Is this a quirk, or by design? I prefer the tidier syntax for when I'm…
TheDeadMedic
  • 9,948
  • 2
  • 35
  • 50
0
votes
2 answers

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

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…
Hailwood
  • 89,623
  • 107
  • 270
  • 423
0
votes
1 answer

Smarty variables, assigning javascript function as value does not work (upgrading from v2 to v3)

I have the following code, that works for smarty 2.x {assign var=somename value=jsFunction($frontItemKey);} but smarty v3 throws an error: unknown function "jsFunction" How can I fix this? Thanks!
mspir
  • 1,664
  • 2
  • 21
  • 34
0
votes
1 answer

Print out value of assign from smarty plugin before plugin is called

I am trying to develop an advertising system around smarty. So i came up with a plugin which when spitted out on the page looks like this: {load_ad id=c4ca4238a0b923820dcc509a6f75849b} The trouble is that inside that function i have a variabled…
Nick M.
  • 155
  • 1
  • 6
0
votes
1 answer

Smarty 3 assign variable in template

Having a bit of a problem. Trying to assign a template variable within a smarty 3 template file but it just doesnt seem to register it. I know I can use this in the controller: $this->data['myVar'] = 'something'; Dont want to use that. I have tried…
fl3x7
  • 3,723
  • 6
  • 26
  • 37
-1
votes
1 answer

Forms with Kohana 3.2 and Smarty

Good day! I'm learning Kohana (3.2) with Smarty (MrAnchovy-Kohana_Smarty). I created a simple form with one field which is validated after submission. I'd like the field to be repopulated with the submitted value when the validation fails. How can I…
Vojtech
  • 2,533
  • 9
  • 34
  • 65
-1
votes
1 answer

Smarty:- Create an associative array using for loop and check wheather value exists in array

i am new to smarty and a dont know how to Create an associative array using for loop and check wheather value exists. But i created the array in php and checked value exists. Can anyone help me to code the same in smarty tpl…
Roopesh M
  • 55
  • 1
  • 7
-1
votes
1 answer

php wont load smarty when using pdo

I have a php file that calls a smarty template, it works and all of the variables are passing correctly. The php files that do not require a smarty template are connecting to the database with no problems. THE PROBLEM: anytime I enter a PDO…
vsmayberry
  • 67
  • 3
-2
votes
1 answer

If statment with date create in smart php

How can I create a validation in smarty php, allowing the value to appear if it is within 30 days of the specified date? In array: Array (4) 0 => Array (13) id => 6496 invoicenum => 6496 datecreated => "08/09/2020" normalisedDateCreated =>…
zecaluis
  • 145
  • 1
  • 9
-2
votes
1 answer

Smarty: Why regex_replace with not working when use class in tag?

I am using smarty 3. I have tried this code: {$ver|regex_replace:"/something/":"
anything
"} and it returned the following error: HTTP ERROR 500 If I remove the class="xyz" inside the div tag and use the following code:…
Smaller
  • 107
  • 2
  • 11
-3
votes
1 answer

How to use .env file in smarty?

I am new to smarty template. My all database settings are in /inc/settings/DSOPSettings.local.php but Every time I get pull from git for changes It overrides. I have tried to set .env file in smarty template project root tried to get env variables…
-3
votes
2 answers

What is the meaning of 's' in {l s='Accept PayPal' mod='paypal'}

I'm new to Prestashop. While learning I found this {l s='Accept PayPal' mod='paypal'} I'm curious what does s means in the above statement. I know l is for the language but I don't know the meaning of s.
Jack
  • 3
  • 6
-6
votes
1 answer

How to pass array from php to javascript using smarty 3?

In php file When I code like this $names = ["jim", "lucy"]; $smarty->assign('names', $names); In javascript, var arr = {$names}; Smarty will parse the {$names} as ..."... . What should I do to avoid this? I want Smarty parse the array as var…
Hexor
  • 525
  • 1
  • 8
  • 22
1 2 3
24
25