Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Best Way To Define Params For A Widget?

$
0
0
Hi,

I'm creating a widget where there will be 2 types of params:
- The one that can change depending on where we call the widget, those one will be defined in the widget call:

<?php $this->widget('ext.myWidget', array(
    'someParams' => 'someValues',
)); ?>


- The one that are the same for all the call to the widget (a path to a library, a place to save an image, ...)

I would like to know what is the best way to define the second type of parameters.
I'm hesitating between making the user define it in the params array in the config file or defining it in an array in the Widget file. The main advantage of the first option is that the user won't have to modify the Widget file so in case of update his modifications won't be overwritten, but this is not a specific user params so putting it in the parmas array in config file might seem strange.

So what would be the best solution? If there is another one better thant the 2 above please tell me!

Viewing all articles
Browse latest Browse all 18717

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>