Building an application with Yii 1


I’ve built a couple projects with Yii previously and really enjoyed how easy it was to rapidly build a professional application. For my new Yii project I have a set of user requirements and about 100 hours to get it done. So, I’m going to look into some Yii extensions and packages to build this out even more rapidly than before. From a development standpoint, I have just a few requirements:

  1. Yii v1.x
  2. Boostrap CSS v3
  3. Separated front and backend
  4. User and role management

 

What is Yii Phundament?

I tried out this Yii package and after asking this question for about an hour and a half, I decided it wasn’t suited for my project. There isn’t any decent documentation explaining what Phundament is, other than “you will like it”. I might have liked it if there was a little documentation. Unfortunately it’s not worth any more of my time to try and figure out what it is and how to use it. It’s basically Yii with about 20 extensions, most of which I probably wouldn’t need, that are installed via composer. It appears to be a CMS application on top of Yii. Here is a link to the phundament demo.

 

Yii Boilerplate

For my project I ended up going with Yii Boilerplate primarily because it already has the backend and frontend separated, along with environment overrides, already thought out and implemented. Here is an installation tutorial that is mostly correct, but there were a few instructions that were no longer correct, like the names of the override files. The instructions also didn’t mention where to run yiic from, which is the /bin directory. There are a number of development tools required by composer, such as selenium and Symphony components that I won’t be using out of the box, but I’ll leave them for now and may use them later. I had this installed and was able to log into the backend and the Gii module in about 20 minutes.

 

Boilerplate tweaks

  1. I wanted to use Bootstrap CSS v3, and the composer package “clevertech/yii-booster”: “dev-master” that comes with boilerplate will give you Boostrap v2. Once you run “composer update”, the “dev-master” will give you the latest version of yii-booster, which will cause errors such as “Alias “bootstrap.filters.BootstrapFilter” is invalid” . So, you’ll need to change the composer.json file to “clevertech/yii-booster”: “3.1.1” . Or, if you want to use bootstrap 3 like I did, then follow these instructions to make Yii Boilerplate use bootstrap 3

Leave a comment

Your email address will not be published. Required fields are marked *

One thought on “Building an application with Yii

  • Daniel

    Hi great extension and percojt structure , looks extremly promissing but as it’s structure is based on event driven programming it changes from a classic Yii way of workingMaybe a little explaining would be usefull for the community to grasp how Yiibackboneboilerplate runs. once I’m rolling I’d be glad to make a tutorialCould you drive me through a whole url process as an example baseThanksTibor