热门面试题与答案和在线测试
面向面试准备、在线测试、教程与实战练习的学习平台

通过聚焦学习路径、模拟测试和面试实战内容持续提升技能。

WithoutBook 将分主题面试题、在线练习测试、教程和对比指南整合到一个响应式学习空间中。

面试准备

模拟考试

设为首页

收藏此页面

订阅邮箱地址

Yii 面试题与答案

问题 21. How to handle form submissions in Yii?

You can handle form submissions in Yii by using the CActiveForm widget and processing the form data in the controller action.

Example:

// if(isset($_POST['Model'])) { $model->attributes=$_POST['Model']; if($model->save()) { // success action } }

这有帮助吗? 添加评论 查看评论
 

问题 22. Explain Yii's CSRF protection.

Yii includes built-in CSRF protection to prevent cross-site request forgery attacks. It can be enabled by adding the 'csrf' filter to controller actions.

Example:

// public function filters() { return array('csrf', 'accessControl'); }

这有帮助吗? 添加评论 查看评论
 

问题 23. What is Yii's asset manager?

The asset manager in Yii is responsible for managing and publishing asset files such as CSS, JavaScript, and images.

Example:

// $baseUrl = Yii::app()->getAssetManager()->publish(Yii::getPathOfAlias('application.assets'));

这有帮助吗? 添加评论 查看评论
 

问题 24. How does Yii handle authentication?

Yii provides various authentication methods, including RBAC, password-based authentication, and integration with external authentication systems.

Example:

// Yii::app()->user->login($identity);

这有帮助吗? 添加评论 查看评论
 

问题 25. What is Yii's event handling?

Yii's event handling allows you to attach event handlers to components and execute custom code when specific events occur.

Example:

// $component->onEvent = function($event) { // handle event };

这有帮助吗? 添加评论 查看评论
 

用户评价最有帮助的内容:

版权所有 © 2026,WithoutBook。