Shortcut functions

how to use this shortcut functions with arrays

shortcut function:


function param($name)

{

        return Yii::app()->params[$name];

}




thanks

What is the problem? What do you need to achive?

Hi,




// now you have to have additional variable

$array = param('array_name');

$array['some_setting'];


// since php 5.4 you can write like this

param('array_name')['some_setting']

// See http://wiki.php.net/rfc/functionarraydereferencing 



i use that one but i won’t work.


Yii::app() -> clientScript -> registerMetaTag(param('metaName')['robots'],'robots', null, null);

You cannot do with this syintax, you must write it in 2 lines

I see thanks bro.