Yii 1.1: Kickstart development with Yii-App

42 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

#18830 report it
hajdar at 2015/01/19 05:53am
language problem

WebApplication and its behaviors do not have a method or closure named "getLanguages".

#15059 report it
whatif at 2013/10/03 03:51am
I wish this yii-app be easier to install

Thanks for this great extension.

But the installation of this extension requires much of knowledge other than Yii. One have to know how to use Git, Composer, Npm, Grunt, Less compilation .....

I didn't succeed to install this great extension though I tried several times and am still struggling to resolve the errors which occurred during the installation of the installation tools.

This does not seem to be "KICKSTART" development. I wish the installation be really easy suitable for "KICKSTART"

#15003 report it
almix at 2013/09/27 02:11pm
[SOLVED] want webroot without /web

How to make site opening without web/index.php? just the root domain. Need I move script index.php to the root folder? then I need to edit many configs...

May be something in .htaccess?

SOLVE: Think it's better on hosting connect domain with '/web' directory (not with yii-app project directory) - now think, Chris made '/web' right for this purpose, for more security.

#14654 report it
Chris83 at 2013/09/01 02:59pm
@gb5256

Yes it should work fine. Yii-app has undergone a lot of changes lately, see the README.md for more information on this.

#13754 report it
gb5256 at 2013/06/22 03:29pm
Gii ?

Hello, just a smal question. Is the bootstrap version of Gii also working out of the box with the app?

#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?

Leave a comment

Please to leave your comment.