1. Question:How to add external javascript in YII? 

    Answer
    Yii has a special class named CClientScript that can help include scripts, CSS, and other resources in the page.
    In order to include an external JS , you can use the following code:
    Yii::app()->clientScript-> registerScriptFile('http://example.com/js/main.js);






    1. Report
  2. Question:Name the configuration file in YII and where it is located? 

    Answer
    The name of configuration file is main.php and it is located in protected/config/main.






    1. Report
  3. Question:Name the configuration file in YII and where it is located? 

    Answer
    The name of configuration file is main.php and it is located in protected/config/main.






    1. Report
  4. Question:How to activate mysql database driver in yii and in which file you have to work? 

    Answer
    We can active MySql database driver in YII by this way:
    'connectionString' => 'mysql:host=localhost;dbname=yii_sir',
    'username' => 'root',
    'password' => '',
    and we have to work on  protected/config/ database.php






    1. Report
  5. Question:How to import custom classes in yii? 

    Answer
    We can import custom classes in YII by following way:
    <?php Yii::import(“application.Something.Animal/MountDuck”); ?>






    1. Report
Copyright © 2025. Powered by Intellect Software Ltd