Category: Yii 2

Yii 2

Use External JavaScript file in yii2

Use External JavaScript file in yii2

The arguments for registerJsFile() are similar to those for registerCssFile(). In the following example, we register the main.js file with the dependency on the yii\web\JqueryAsset. It means that the main.js file will be added...

Adding Javascript or Jquery code in Yii2

Adding Javascript or Jquery code in Yii2

Registering inline scripts Inline scripts are useful for configuration, dynamically generated code and small snippets. The registerJs() method for adding these can be used as follows: Using inline scripts (code should be inserted after...

Seperate backend and frontend sessions Yii2

Seperate backend and frontend sessions Yii2

We are configuring different identity cookies and sessions for your user component for frontend and backend. identityCookie property Add user and session property arrays in file backend\config\main.php in components array (FOR BACKEND) Add user...