Im just trying Yii2. Now I have created a yii2 basic appication. Next what I want to do is change the theme. I have an HTML file I want to change this appications theme as like that HTML. I have gone through yii2 theming But Its not what i want I want to add all css,js,images,font of that HTML to my project. How can I do this in yii2 Plz somebody help me.
相关问题
- Yii - Eliminate default controller ID for a module
- how to change csrf field id from YII_CSRF_TOKEN to
- Load balancing with Yii sessions
- Yii uploading pictures
- what a part does bower/bower-asset play in php app
相关文章
- Can you run console jobs from yii2-basic?
- How to do a bulk database insert in Yii2?
- How to send mail to multiple recipients in Yii2 ma
- Yii2 - check if the user is logged in view
- Render html in yii2 Gridview Widget
- Yii2 - How do I AutoLoad a custom class?
- Call static method from a string name in PHP
- radioButtonList checked by default
Hi you have to do following things for theming in yii2 as simple as yii1 :-
then in component array pass view array like:
now create the folder name as "themes" into web directory.
In this themes folder copy your html folder like(demo) which contains all css, js etc. files. in this folder create views folder as yii which contains main.php and others layouts if needed.
override index.php in views by your corresponding index file by appropriate changes into paths of files. create corresponding views and actions for your html files. in yii2 we can define our css and js into Appasset.php .
Hi you need to do a few things to start off.
Copy the new HTML template Css, JS, Plugins and Images into your project directory eg testdrive/assets/
We need to link the CS and Js files to the project. Go to testdrive/protected/views/layouts/ directory and create a new file eg main.php add the respective css and js links to the respective files as you would on a html file in the head section.
3.Once the layout is ready we need to initialise yii to use the layout we have created. Proceed to the Controller eg SiteController.php