Yii Questions et reponses d'entretien
Question 11. What is Yii's extension?
Extensions in Yii are packages that provide reusable features, and they can be easily integrated into Yii applications.
Example:
// Yii::import('ext.example.MyClass');
Question 12. Explain Yii's caching mechanism.
Yii provides support for caching to improve application performance. It includes data caching, page caching, and fragment caching.
Example:
// $dependency = new CDbCacheDependency('SELECT MAX(last_modified) FROM posts'); Yii::app()->cache->set('posts', $data, 3600, $dependency);
Question 13. What is Yii's console application?
Yii's console application allows you to run commands from the command line, providing a way to perform tasks such as database migrations and cron jobs.
Example:
// $ yii migrate/up
Question 14. Explain Yii's error handling.
Yii provides a robust error handling mechanism, including detailed error pages, logging, and the ability to customize error messages.
Example:
// throw new CHttpException(404, 'The requested page does not exist.');
Question 15. What is Yii's internationalization (i18n) and localization (l10n) support?
Yii provides powerful tools for internationalization and localization, allowing you to easily translate messages and format dates, numbers, and currencies.
Example:
// Yii::t('app', 'Hello, {name}!', array('{name}' => 'John'));
Les plus utiles selon les utilisateurs :