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 />

......,<br />

'viewRenderer'=>array(<br />

'class'=>'CPra<strong>do</strong>ViewRenderer',<br />

),<br />

),<br />

);<br />

By default, CPra<strong>do</strong>ViewRenderer will compile source view files and save the resulting<br />

PHP files under the runtime directory. Only when the source view files are changed, will<br />

the PHP files be re-generated. Therefore, using CPra<strong>do</strong>ViewRenderer incurs very little<br />

performance degradation.<br />

Tip: While CPra<strong>do</strong>ViewRenderer mainly introduces some new template tags to make<br />

writing views easier and faster, you can still write PHP code as usual in the source<br />

views.<br />

In the following, we introduce the template tags that are supported by<br />

CPra<strong>do</strong>ViewRenderer.<br />

Short PHP Tags<br />

Short PHP tags are shortcuts to writing PHP expressions and statements in a view. The<br />

expression tag is translated into ; while the<br />

statement tag to . For example,<br />

<br />

<br />

is translated into<br />

<br />

<br />

Component Tags<br />

Component tags are used to insert a widget in a view. It uses the following syntax:

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

Saved successfully!

Ooh no, something went wrong!