Yii perguntas e respostas de entrevista
Pergunta 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');
Pergunta 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);
Pergunta 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
Pergunta 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.');
Pergunta 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'));
Mais uteis segundo os usuarios: