pembrock pembrock - 3 years ago 311
Smarty Question

Using php class property in smarty template

Can i use php class static properties in smarty template?
For example:

class UserData
const INDEX = 1;
const STREET = 2;

static public $_address_fields = array(

And in my smarty template i want do something like this:


Is it possible?

Answer Source

You should be able to pass this in from your controller?

For example: $smarty->assign('AddressFields, UserData::$_address_fields);

This should then be avilable for use in your template like so: {$AddressFields}

Smarty Docs:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download