Kickstart development with Yii-App

40 followers

Introduction

I recently created a project called Yii-App on GitHub to kickstart my development of smaller Yii applications. The main goal of the project is to provide a ready-to-use application template that includes my bootstrap extension and many other useful extensions. After reading this article you will be able to use this project as a starting point for all of your Yii projects.

Setup

Setting up your project using Yii-App is a breeze, it shouldn't take you more than a couple of minutes. Follow the steps below and you'll be ready in no time.

  1. Download the project from the GitHub page or clone it using git.
  2. Go to Yii downloads and download the latest stable release of Yii and place in the yii folder.
  3. Configure your application through main.php and params.php
  4. Open your project in a browser and test that it works
  5. Start developing your application!

What's included

Yii-App comes with a toolbelt of extensions:

  • Yii-Bootstrap Twitter Bootstrap widgets
  • Yii-LESS LESS compiler with support for both client- and server-side compilation
  • IMG Image management and versioning
  • Yii-Auth User interface for access control
  • Yii-SEO Search engine optimization
  • YiiPasswords Strong password using BCrypt
  • Yii-Multilingual Multilingual support

If you have any questions regarding the use of the extensions please consult the extension documentation. I have developed most of the extensions included so I'll keep them up-to-date and provide full support for them also in the future.

Thank you for reading. Feel free to leave your comments below.

Total 20 comments

#12505 report it
santhika at 2013/03/24 09:44pm
dropdown menu dont appear

i try to use dropdown menu in yii app...but the menu dont appear..i already try several time but no luck. any suggestion?

thank u

#12503 report it
zyphers at 2013/03/24 03:48pm
Can't click link?

I've already install Yii-App without any problem. But when I go to the main web page I can't click on the link to other page. For example, login page. It is there in the page but when I click it the browser don't go to that page but the URL itself is fine when I type in the URL directly it's ok. I don't see any error on browser's console. Any idea what could be the problem. Thanks.

#12410 report it
santhika at 2013/03/18 11:25pm
css and js not loaded

i already try the new yii-app. i can installed it well but unfortunately when i run it on the web the css n js file not running well it cause the application just show plain text. any suggestion to handle it?


i already fix it. i miss 1 step in compiling less with grunt...shame on me

#11949 report it
Ramkrishna Chaulagain at 2013/02/15 01:11am
Nice work

Hi! this is really appreciable work.

#11948 report it
Chris83 at 2013/02/14 05:05pm
Less issue fixed

The less issue should be fixed now, it was the less watcher. Seems that it was a bit too heavy to coup with compiling bootstrap over and over again. :)

#11743 report it
sepu at 2013/01/31 05:45am
Infinite *.less requests

Ok this is the problem: https://github.com/Crisu83/yii-app/issues/2

#11742 report it
sepu at 2013/01/31 05:40am
I just download the last version from GITHUB but same error on LESS

If you run the site on firefox 18.0.1 the site is very very very very very slow.

<h3>n is undefined</h3><p>in <a href="http://localhost/yii-app-master/web/less/bootstrap.less">bootstrap.less</a> <br>r.Parser/p.parse@http://localhost/yii-app-master/web/assets/35b8f7aa/less.min.js:8<br>w/&lt;@http://localhost/yii-app-master/web/assets/35b8f7aa/less.min.js:8<br>a@http://localhost/yii-app-master/web/assets/35b8f7aa/less.min.js:8<br>x@http://localhost/yii-app-master/web/assets/35b8f7aa/less.min.js:8<br>w@http://localhost/yii-app-master/web/assets/35b8f7aa/less.min.js:8<br>r.Parser.importer@http://localhost/yii-app-master/web/assets/35b8f7aa/less.min.js:8<br>@http://localhost/yii-app-master/web/assets/35b8f7aa/less.min.js:8<br>e.Import@http://localhost/yii-app-master/web/assets/35b8f7aa/less.min.js:9<br>r.Parser/p.parsers.import@http://localhost/yii-app-master/web/assets/35b8f7aa/less.min.js:8<br>E@http://localhost/yii-app-master/web/assets/35b8f7aa/less.min.js:8<br>r.Parser/p.parsers.directive@http://localhost/yii-app-master/web/assets/35b8f7aa/less.min.js:8<br>E@http://localhost/yii-app-master/web/assets/35b8f7aa/less.min.js:8<br>r.Parser/p.parsers.primary@http://localhost/yii-app-master/web/assets/35b8f7aa/less.min.js:8<br>E@http://localhost/yii-app-master/web/assets/35b8f7aa/less.min.js:8<br>r.Parser/p.parse@http://localhost/yii-app-master/web/assets/35b8f7aa/less.min.js:8<br>w/&lt;@http://localhost/yii-app-master/web/assets/35b8f7aa/less.min.js:8<br>a@http://localhost/yii-app-master/web/assets/35b8f7aa/less.min.js:8<br>x@http://localhost/yii-app-master/web/assets/35b8f7aa/less.min.js:8<br>w@http://localhost/yii-app-master/web/assets/35b8f7aa/less.min.js:8<br>g@http://localhost/yii-app-master/web/assets/35b8f7aa/less.min.js:8<br>r.refresh@http://localhost/yii-app-master/web/assets/35b8f7aa/less.min.js:9<br>@http://localhost/yii-app-master/web/assets/35b8f7aa/less.min.js:9<br>@http://localhost/yii-app-master/web/assets/35b8f7aa/less.min.js:9
#11741 report it
sepu at 2013/01/31 05:13am
Problem with LESS

n is undefined

in bootstrap.less r.Parser/p.parse@http://localhost/spiga/web/assets/c3d30edf/less.min.js:8 w/<@http://localhost/spiga/web/assets/c3d30edf/less.min.js:8 a@http://localhost/spiga/web/assets/c3d30edf/less.min.js:8 x@http://localhost/spiga/web/assets/c3d30edf/less.min.js:8 w@http://localhost/spiga/web/assets/c3d30edf/less.min.js:8 r.Parser.importer@http://localhost/spiga/web/assets/c3d30edf/less.min.js:8 @http://localhost/spiga/web/assets/c3d30edf/less.min.js:8 e.Import@http://localhost/spiga/web/assets/c3d30edf/less.min.js:9 r.Parser/p.parsers.import@http://localhost/spiga/web/assets/c3d30edf/less.min.js:8 E@http://localhost/spiga/web/assets/c3d30edf/less.min.js:8 r.Parser/p.parsers.directive@http://localhost/spiga/web/assets/c3d30edf/less.min.js:8 E@http://localhost/spiga/web/assets/c3d30edf/less.min.js:8 r.Parser/p.parsers.primary@http://localhost/spiga/web/assets/c3d30edf/less.min.js:8 E@http://localhost/spiga/web/assets/c3d30edf/less.min.js:8 r.Parser/p.parse@http://localhost/spiga/web/assets/c3d30edf/less.min.js:8 w/<@http://localhost/spiga/web/assets/c3d30edf/less.min.js:8 a@http://localhost/spiga/web/assets/c3d30edf/less.min.js:8 x@http://localhost/spiga/web/assets/c3d30edf/less.min.js:8 w@http://localhost/spiga/web/assets/c3d30edf/less.min.js:8 g@http://localhost/spiga/web/assets/c3d30edf/less.min.js:8 r.refresh@http://localhost/spiga/web/assets/c3d30edf/less.min.js:9 @http://localhost/spiga/web/assets/c3d30edf/less.min.js:9 @http://localhost/spiga/web/assets/c3d30edf/less.min.js:9

#11691 report it
Chris83 at 2013/01/27 04:55pm
@Daniel

I'll take a look at that extension, it looks great.

#11681 report it
Daniel at 2013/01/27 02:49am
suggestion

Hi Chris,

Yii-app is almost complete to what I usually use in developing new project. Just need very simple user management (just managing user+password and authentication) and input to sanitize request.

Do you consider to include input in yii-app?

Thanks,

Daniel

#11679 report it
Chris83 at 2013/01/26 07:29pm
@Mustafa

Here's the missing method, sorry about that:

public function actionChangeLanguage($locale)
{
    if (in_array($locale, array_keys(Yii::app()->languages)))
        Yii::app()->user->setState('__locale', $locale);
    $this->redirect(array('index', 'language'=>$locale));
}
#11676 report it
Mustafa Abu Ghali at 2013/01/26 01:22pm
Change Language

Dear Can you please specify what should be inside /site/changeLanguage action of the controller. How to use the multilanguage extension.

Many thanks

#11631 report it
Chris83 at 2013/01/23 03:45pm
@Porcelanosa

We are actually having a meeting later this week with Antonio Ramirez (Lead developer of YiiBooster) to join our efforts. The plan is to make the two extensions compatible. And no, I will not change to use SASS because Bootstrap uses LESS and it's a core component in my Yii development.

#11630 report it
Chris83 at 2013/01/23 03:43pm
@Quang Kim

I've fixed the assets issue now, it was my bad as I normally import the less files from assets but it doesn't work across different projects as the published assets folder will differ from project to project. I've added the bootstrap less files under less/bootstrap and import them from there. Now it seems to work fine. Sorry about the inconvenience.

#11624 report it
Porcelanosa at 2013/01/23 09:08am
Why You don`t cooperate with YiiBooster?

And second question? Are you plannig to use SASS instead LESS?

#11618 report it
Quang Kim at 2013/01/23 04:19am
HI

Hi Chris83,

I know why. I think you shouldn't import file from assets folder

#11617 report it
Quang Kim at 2013/01/23 04:15am
@Chris83

@Chris83 Hi Chris83,

I don't understand. the path of less js file in assets forder. Please show me how to fix it?

#11616 report it
j0ker_ at 2013/01/23 03:24am
Error after run

Property "TbMenu.itemCssClass" is not defined.

app\extensions\bootstrap\widgets\TbBaseMenu.php(66)

if ($this->itemCssClass !== null)
   $classes[] = $this->itemCssClass;

Update yii to 1.1.13 and its works!

#11615 report it
Chris83 at 2013/01/23 03:16am
@Quang Kim

Hey, fix the assets paths in the less files and you should be fine.

#11610 report it
Quang Kim at 2013/01/22 09:26pm
Not loaded less

I just download it and get issue as below http://dl.dropbox.com/u/50358043/2013-01-23_09h21_11.png

Leave a comment

Please to leave your comment.