Pimped Template app

Im dropping this here because sharing is caring. And its my way to say thank you to everyone making Yii awesome, thank you for great extentions, great tips and help.


There Is some things we use in most apps, others that I’ve seen is very popular in the yii-community and some stuff like user registration seems to be a tough nut to crack for beginners. So I took the Yii blog demo and Pimped it some.

This is suppossed to replace the default web-app generated by yiic. To kickstart your projects some more.

You will notice I’ve used several extentions, but this is because they are simple great and usefull.

I’ve tested 30-40 but kept only 8.


  • A simple but secure user Registration using blowfish (truely random hash with salt)

The blog demo uses only md5 with salt, some user management systems I’ve tested doesnt even have that, this is really stupid so something needed to be done.

A big thank you to tom[] who made the randomness extention which I use for this.

*Use the user model just as any normal AR and add the features you need.

*Profile url is /profile/u/$username (or /user/view?id=$id)

*After a user has registred, a directory for him is created in /files/users/$user_id. This dir is used by multiple features and you can put user specific files there:)

*Avatar upload with xUpload, drap&drop support etc (check the xupload extention,its awesome)

*User presentation can be designed with eltre WYSIWYG-editor. I picked this one after testing every else, because the elfinder functionality was so easy to setup and its very powerfull.

*Elfinder is a filemangement tool used with the eltre editor. I made so that It always uses the users own directory, giving him a library of images and files/folders which he then can access and use wherever the eltre editor is activated

(for example when creating new blog posts)

*The personal file library is shown below the presentation on the profile, it can be hidden by the user if he wants to.

(I set up some examples of usage for this file library,for example images is rendered as a fancy box gallery, files are linked for download and subfolders are always ignored so the user can hide some private files/photos even with a public library. Move/copy/zip/unzip/delete/preview/view info etc possible ( google eltre+elfinder to see all functions )

*Login and registration is availble in bootstraped modal windows or just normal links in the menu.

*Accesscontrol is done with RIGHTS. The most used rbac by Chris83. Its all setup just go go:) (no more trying to combine some user management tool with rights)

Other none user related stuff**

*Cmenu replaced with mbmenu(thx again to the extention author), motivation: Multi dropdown possibilites. And I just like it.Alot.

*Bootstrap, I have one version of this app with bootstrap and one withhout. Chris83 is doing an amazing job bringing bootstrap to yii. But I know some people prefer other css frameworks or just doing it by themselves. So pick what u prefer.

*Multi model form handling seems to be hard, And I agree it was not the easiest to understand. So I included (but not used)

the wForm extention that can make life so much easier for you. Handles all kind of relations in one form., Their advanced demo is included and working (products). (it also uses client side cloning of form fields)

*Fancy box ofc extention is in there, example use on the profile. But its easy to remove this if you dont need it.

  • Eltre editor re-used for the posts model. Remember a user can access his file library here to,and re use pictures or files and attach them to a blog post.

  • For comments I used eltre again, but set it to use the tiny toolbar instead. Again, you can do it totally diffrent if you want.

  • I also put in debugtoolbar, which is awesome if you for example want to see what sql queries yii is doing. Its availeble with a little icon up in the left corner:) (remove this on your production server)

  • I took the liberty to create a model file in components folder, I extend all models from this one instead. Unessecary according to some but I like to have the option atleast. There is not much stuff in the Controller and Model classes, but you could check them before you start modifying the app:)

The version with bootstrap:

Project is on git hub

I decided to make the code as readable as possible and not include to much stuff, and what extention that is added can easily be removed or replaced.

I will also setup a demo site asap, I just have so much to do currently. And host the none-bootstrap version when I’ve decided how to best do that:p

Problems related to one of the extention should be lifted in respective thread.

Sql is here: http://www.2shared.com/document/fu5JVLVB/blog_2012_03_09.html

Thanks a lot buddy, really helped me.

NOTE: moved to proper section (Yii-powered Application instead of Tips, Snippets and Tutorials)

That was the purpose:) glad you liked it.

Looks cool, might use it.

I tried to edit the static page "about us" but without success.

I hope this feature will be added soon