yii-base A responsive Yii theme utilising all the goodness of H5BP and Twitter Bootstrap.

  1. Update
  2. Requirements
  3. Usage
  4. Resources
  5. Notes
  6. Tips
  7. License

A responsive Yii theme utilising all the goodness of H5BP and Twitter Bootstrap.

After trying various Yii Bootstrap extensions, I decided to create a simple theme that uses Yii's standard components and widgets.

The theme takes advantage of the fantastic HTML5 Boilerplate (H5BP) with a modified .htaccess to enable pretty urls in Yii.

H5BP's best practices and .htaccess can dramatically increase the performance of your website. Try it in YSlow!

Update

So you want to use it with CGridView?

Download the pager extension here:

http://www.yiiframework.com/extension/bootstraplinkpager/

See the comments below for example.

Requirements

Tested on Yii 1.1.10

Usage

  • Create a new webapp in Yii.

  • Copy all files from archive, overwriting config/main.php

  • Open .htaccess in your root folder and set 'RewriteBase /base/' to your application's root folder or '/' if the app is in your webroot (typical in production).

Resources

Notes

By default I make the assumption that you are using Apache and the .htaccess enables URL Rewriting. The theme can be used without pretty urls by deleting/renaming the .htaccess file and modifying the urlManager properties in the main config file.

Currently there is no Gii generator for the view files. I may look into adding this when I have more time, or you're welcome to get involved yourself. Instead, you should create the views as usual and copy them over to the theme folder for modification. This has the benefit of having a fallback to Yii's standard theme.

You will see how I have modified the standard contact and login pages which should help you on your way. Compare them side by side and see how I have added the necessary css classes to the standard widgets. I have also removed the divs that wrap the input fields since they're not needed and the css class 'row' conflicts with Bootstrap's own.

EDIT: This generator may work: http://www.yiiframework.com/extension/giiplus/ but I haven't tried it. A brief look at the source from the demo shows some remnants of the old Blueprint classes.

Tips

Don't modify the Bootstrap files. Use the included styles.css and script.js so that you can easily update Bootstrap when necessary. However, I have combined bootstrap.min.css and bootstrap-responsive.css as bootstrap-and-responsive.min.css. Why make 2 trips to the server? You will need to be aware of this if you update the Bootstrap files.

License

Free to use under the terms of any respective Yii, H5BP or Twitter Bootstrap Licenses.

The logo license details can be found here: http://www.yiiframework.com/logo/

6 0
20 followers
1 606 downloads
Yii Version: 1.1
License: MIT
Category: Others
Developed by: outrage
Created on: Jul 1, 2012
Last updated: 11 years ago

Downloads

show all

Related Extensions