OXID Community Forum

> International Forums > Modules > php variables in tpl
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Thread: php variables in tpl

Thread Tools Search this Thread Display Modes
#Top   #1  
Old 08-15-2016, 01:51 PM
EleGiggle EleGiggle is offline
Junior Member
Join Date: Aug 2016
Posts: 1
EleGiggle is on a distinguished road
Default php variables in tpl

I'm trying to write a module altering a couple of templates. My problem is that I can't seem to assign variables defined in a php file to use them in a tpl file. I gathered the way to do this is via

$var = 'whatever';
$smarty->assign('var', $var);

However, the variable doesn't seem to be assigned correctly as it is not listed in the templates variables list retrieved by [{debug}] and as a result the field were the variable is supposed to be shown ends up being null.

I managed to assign variables in the tpl file directly with
[{assign var=test value="whatever" scope="global"}]
and can also use this one in another tpl.

Does anyone have an idea what it is that went wrong or that I am missing?
Reply With Quote
#Top   #2  
Old 08-15-2016, 02:08 PM
vanilla thunder's Avatar
vanilla thunder vanilla thunder is online now
Marco's Sidekick
Join Date: Nov 2010
Posts: 6,374
vanilla thunder is on a distinguished road
Default AW: php variables in tpl

this might be useful for you:
Reply With Quote
#Top   #3  
Old 08-15-2016, 02:11 PM
foxido.de foxido.de is offline
Senior Member
Join Date: Jul 2013
Posts: 1,129
foxido.de is on a distinguished road
Default Re: php variables in tpl



- Modulentwicklung, Komplette Systeme, Beratung, Service

Tel: 02841-9161670

Deep-AutoSuggest, der neue Finder 4.6x 4.10.x und 90 weitere Module
Reply With Quote


php, tpl, variables

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Nicht Sichtbar
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Which variables are available in the theme? Anpan Templates and Design 6 06-16-2014 12:56 PM
variables gnomic Newbies 6 01-23-2013 07:02 AM
Newsletter: Integration of new variables sweyn Templates and Design 5 03-09-2012 06:24 PM
Global variables for diffrent paths betatest Developers 2 05-18-2010 03:21 PM
Available Variables in Templates druckbar Templates and Design 1 01-30-2009 01:24 PM

All times are GMT +1. The time now is 05:14 PM.