20.11.2014 Views

O Guia Definitivo do Yii 1.1

O Guia Definitivo do Yii 1.1

O Guia Definitivo do Yii 1.1

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

eturn array(<br />

'components'=>array(<br />

'widgetFactory'=>array(<br />

'widgets'=>array(<br />

'CLinkPager'=>array(<br />

'maxButtonCount'=>5,<br />

'cssFile'=>false,<br />

),<br />

'CJuiDatePicker'=>array(<br />

'language'=>'ru',<br />

),<br />

),<br />

),<br />

),<br />

);<br />

In the above, we specify the global widget customization for both CLinkPager and<br />

CJuiDatePicker widgets by configuring the CWidgetFactory::widgets property. Note that<br />

the global customization for each widget is represented as a key-value pair in the array,<br />

where the key refers to the widget class name while the value specifies the initial property<br />

value array.<br />

Now, whenever we create a CLinkPager widget in a view, the above property values will<br />

be assigned to the widget, and we only need to write the following code in the view to<br />

create the widget:<br />

$this->widget('CLinkPager', array(<br />

));<br />

'pages'=>$pagination,<br />

We can still override the initial property values when necessary. For example, if in some<br />

view we want to set maxButtonCount to be 2, we can <strong>do</strong> the following:<br />

$this->widget('CLinkPager', array(<br />

'pages'=>$pagination,<br />

'maxButtonCount'=>2,<br />

));<br />

Skin<br />

Note: this feature has been available since version <strong>1.1</strong>.0.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!