Separate Timezone or Country file

Hi there,

I would like to ask you guys, Yii experts, on how to design this matter.

In my registration page, I have a list of $timezones stored in PHP array declared at the top of the file.

And then at the HTML area, the $timezones is called using DropDownList.

echo $form->DropDownList($model,‘timezone’,$timezones);

However, I realize that I need to redeclare this again in the User Control Panel just in case the user wants to change the timezone.

I dont want to redeclare the $timezones array twice.

Is it possible to store the $timezones PHP array in a file which can be called by renderPartial or any other Yii built-in functions?

Or should I just save the $timezones PHP array as a HTML dropdown element (option values) ?

Of course you can store it in a file or in database, as an option.

how can I store the $timezones PHP array in a file?

and how can I call the $timezones PHP array in a file (with no HTML)?

is it using renderPartial? or is there any other Yii built-in functions?

Example:

timezones.php


<?php return array(

    '1'=>'One',

    '2'=>'Two',

    '3'=>'Three',

);

fill $timezones


$timezones = include Yii::getPathOfAlias('application').'/data/timezones.php';

Perfecto!

Thank you Yugene!