Yii is a awesome framework that does many things automatically. As you know, the default installation of Yii App makes site accessible via URL ‘http://www.example.com/basic/web/index.php’ or something like this but in a production server you may wish to hide or remove basic/web from URL in Yii 2.0 as well as access it with SEO friendly URL (‘http://www.example.com/controller/action’).
Category » Yii
Working with Date in Yii 2.0
Yii is a powerful framework where a lot of things happen automagically but learning curves are more complex as compared to any other PHP MVC framework. The first part (before ‘but’ in first line) attracts beginners to learn and experience it while the later part makes them stressed. So I tried here in article Working with Date in Yii 2.0 to simplify the concept by taking ‘Date’ as point.
Install Yii 2.0 Manually or without Composer
Yii is a popular, powerful and highly extensible framework for faster application development. I found many newbies to struggling for successfully install, run and develop Yii application. Those who are learning it may find useful to install Yii 2.0 manually or without composer as demonstrated in this article.
Placing Yii form and submit button in bootstrap 3 modal popup
Many developers fail in placing Yii form and submit button in bootstrap 3 modal popup in right way so either they compromise with the appearance of the modal or complaint that the submit button isn’t working.
Taking a login form as an example if everything is done in right manner then the buttons will appear in modal footer and the modal itself inside form tag and you will see a working form same as illustrated below:
How to change default controller and action in Yii 2.0
Change the default controller with the application configuration of your application. The default action of the specified controller is by default set as index. If you want to change the default action, simply override this property in the controller class,
Hide or remove controller name from url in Yii 2.0
You can hide or remove controller name from url in Yii 2.0 through configuring rules for urlManager component. You can hide controller name from url even if your pages are generated dynamically using database after reading this article.
First of all you have to enable pretty permalinks. After that let’s try to understand how to configure application rules by simple examples.
Creating SEO friendly URL in Yii 2.0 framework
Yii 2.0 framework has a major improvement over version 1.1. Creating SEO friendly URL in Yii 2.0 framework has been a lot easier. All is just turning pretty url ‘on’ to your Yii application and writing very few rewrite rules in htaccess file, enough to hide index.php from your URL and to make them SEO friendly.