Yii perguntas e respostas de entrevista
Pergunta 16. Explain Yii's RESTful API support.
Yii supports building RESTful APIs by providing RESTful actions and making it easy to expose models and data in a RESTful manner.
Example:
// class PostController extends CController { public function actions() { return array('rest' => 'ext.yii-rest-actions.ERestActionProvider'); }}
Pergunta 17. What is Yii's asset bundles?
Asset bundles in Yii allow you to organize and manage assets such as CSS and JavaScript files, improving the efficiency of asset management.
Example:
// class MyAsset extends CAssetBundle { public $css = array('style.css'); } Yii::app()->clientScript->registerPackage('MyAsset');
Pergunta 18. Explain Yii's URL management.
Yii provides a powerful URL management system that allows you to define clean and user-friendly URLs through rules and patterns.
Pergunta 19. What is Yii's CActiveDataProvider?
CActiveDataProvider is a data provider in Yii that provides a set of data for widgets like grids and lists, making it easy to work with database data.
Example:
// $dataProvider = new CActiveDataProvider('Post', array('criteria' => $criteria));
Pergunta 20. Explain Yii's behavior.
Behaviors in Yii allow you to enhance the functionality of a component by attaching additional methods and event handlers.
Example:
// class MyBehavior extends CBehavior { public function extraMethod() { // additional method } }
Mais uteis segundo os usuarios: