You are viewing revision #6 of this wiki article.
This version may not be up to date with the latest version.
You may want to view the differences to the latest version.
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.
- Download the project from the GitHub page or clone it using git.
- Go to Yii downloads and download the latest stable release of Yii and place in the yii folder.
- Configure your application through main.php and params.php
- Open your project in a browser and test that it works
- 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
Please consult the extension documentation for more information on how to use each extension.
Thank you for reading. Feel free to leave your comments below.
Not loaded less
I just download it and get issue as below
@Quang Kim
Hey, fix the assets paths in the less files and you should be fine.
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!
@Chris83
@Chris83
Hi Chris83,
I don't understand. the path of less js file in
assets
forder. Please show me how to fix it?HI
Hi Chris83,
I know why. I think you shouldn't import file from
assets
folderWhy You don`t cooperate with YiiBooster?
And second question? Are you plannig to use SASS instead LESS?
@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.
@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.
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
@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)); }
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
@Daniel
I'll take a look at that extension, it looks great.
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
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/<@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/<@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
Infinite *.less requests
Ok this is the problem: https://github.com/Crisu83/yii-app/issues/2
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. :)
Nice work
Hi! this is really appreciable work.
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
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.
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
Gii ?
Hello,
just a smal question.
Is the bootstrap version of Gii also working out of the box with the app?
@gb5256
Yes it should work fine. Yii-app has undergone a lot of changes lately, see the README.md for more information on this.
[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.
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"
language problem
WebApplication and its behaviors do not have a method or closure named "getLanguages".
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.