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

500 Internal Server Error anchor error

I found this error in my Page Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, admin@localhost and inform them of the time the…
student
  • 181
  • 1
  • 2
  • 8
0
votes
1 answer

Smarty comment stripping and KnockoutJS

I'm trying to use KnockoutJS in my web framework, which uses plain Smarty. Some parts of KnockoutJS's syntax use comments in the form of . Smarty strips all HTML comments (except IE conditionals), including these ones. I…
Martijn
  • 3,696
  • 2
  • 38
  • 64
0
votes
1 answer

Smarty check if is array to fix error cannot use string offset as an array

Depending on the amount of crumbs I have either: [trail] => Array ( [crumb] => Array ( [url] => /app/system [label] => System ) [trail] => Array ( …
John Magnolia
  • 16,769
  • 36
  • 159
  • 270
0
votes
1 answer

change recursive function from Php to smarty?

my problem i have menu endless by this code $result=db::query_tpv("SELECT * FROM tpv_link"); while($row = db::fetch_array($result,'assoc')) { $menu[$row['parent_id']][$row['id_link']] = $row['name_link']; } function…
didoex
  • 1
0
votes
1 answer

How would I go about setting up smarty templates?

I have Smarty 3.1 working with my website for JUST Index.php. Now, how would I add on and make a contact page? 1) Make contact.php and make a whole new template? 2) Make it index.php?page=contact ?? 3) Make contact.php and use the template and pass…
user1973551
  • 29
  • 1
  • 8
0
votes
1 answer

zf2-smarty3 get the actual html value of elements made by the Zend\Form

I'm using ZF2 on our project and lately, we integrated it to Smarty templating system. We already made forms for our views with the help of Zend\Form native to ZF2. My question is: how can I get the actual HTML value (...) on the…
eli_daxs
  • 176
  • 1
  • 10
0
votes
3 answers

Access smarty variables: smarty 3.1.12

I am using smarty 3.1.12 for templating, however in my php files i am tryig to access my smarty variables. All my research has returned answers only for previous versions of smarty.
0
votes
1 answer

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

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…
Tanyio
  • 93
  • 2
  • 6
0
votes
3 answers

Adding content to outer template from inner template with Smarty

I have a site with a fairly complex structure of Smarty templates. For this question, suppose I have an outer template which includes (with {include}) one or more inner templates that are optionally included, depending on the data being…
Brad
  • 159,648
  • 54
  • 349
  • 530
0
votes
1 answer

Categories & Sub-Categories with php, mysql and smarty

I'm building a custom shopping cart for a supermarket with php, mysql and smarty template the products categories and sub categories must be in tow separate tables categories table (id, catname) subcategories table (id,cat_id,subcategory) where…
Nova Design
  • 108
  • 2
  • 12
0
votes
1 answer

Smarty templates conditionals stop working

I have a smarty template that has been working fine for me for some time but for reasons I don't quite understand one of the variables that I "assign" to the template is $activity_date and when I send in time information with my date information it…
ken
  • 8,763
  • 11
  • 72
  • 133
0
votes
1 answer

How to parse & get url of the tag from HTML using smarty and php?

I have a smarty variable which holds the HTML content as value. Inside the HTML content there is an image. I have to extract the url of that image for resize purposes. I know there is a way to parse it in php and assign to smarty variable. But I…
vignesh
  • 512
  • 1
  • 6
  • 25
0
votes
1 answer

Smarty dynamic variable issue

Unfortunately, in my current workplace, I have to use Smarty on a project they had before i was employed. Anyway, I am trying to call in a Dynamic html title for each category in the app. So for example, the title used to be pageTitle="{$category}…
0
votes
1 answer

Smarty 3 output the current position inside foreach loop.

Instead of: {foreach $rows as $row}
  • {$row.title}
  • {/foreach} Is there a way to do something like this? {foreach $rows as $row}
  • John Magnolia
    • 16,769
    • 36
    • 159
    • 270
  • 0
    votes
    1 answer

    Using Extends on subdirectory documents

    The directory is setup like this: common/base.tpl main/foo.tpl main/extras/bar.tpl special/foo.tpl special/bar.tpl In main/foo.tpl, the regular {extends file="common/base.tpl"} works just fine. In special/foo.tpl, the {extends file="main/foo.tpl"}…
    o_O
    • 5,527
    • 12
    • 52
    • 90