1. Question:How and where can you add a client side script in YII? 

    Answer
    The index view is rendered by the index action and is used to initialize the application and provide a do Template that is used for rendering on the client side. We can use it by following way : 
    Yii::app()->clientScript->registerPackage('todo');






    1. Report
  2. Question:How can you add css file in YII? 

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






    1. Report
  3. Question:How to access application configuration parameters in YII? 

    Answer
    application configuration parameters that can be accessed using 
    Yii::app()->params['paramName']
    'params'=>array(
    // this is used in contact page'adminEmail'=>'webmaster@example.com',
    ),






    1. Report
  4. Question:In order to upload file, which html form attributes you have to take. 

    Answer
    We have to use the following html  form attributes : 'htmlOptions'=>array('enctype'=>'multipart/form-data')






    1. Report
  5. Question:Discuss the advantages of using gii in YII. 

    Answer
    Efficient coding with Yii implies efficient use of the gii code generator. It helps to create model,view and controller without writing codes.






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