Yiinitializr: Maximum acceleration for your Yii project start!

The history… we remember the days when we thought that YiiBoilerplate was a good fit for any project. They were good days, but we were being naive.

Every project has different needs, and it’s those needs that set the requirements. Also, lets be realistic, if you were to develop a project where only the frontend UI with a small admin section was needed, Yiinitializr was overkill. In the end, people had to remove unneeded folders, the configuration was unnecessarily complex, a lot of people were not certain where to place the components and there were many other issues.

At 2amigOS! we were slamming our heads down on our keyboards trying to figure out what was the best way to provide a project boilerplate that could fit everyones needs. We soon realized and agreed that composer was the best way to go as a dependency manager (special shout-out thanks to Mr Tobias Schmunk, the guy behind Phundament for his great work and ideas), but we did not want to provide a fixed structure nor a set of extensions, again. Otherwise, we would just be putting a fresh coat of paint on the same problems. We wanted to give the power back to the developer to pick and choose based on their own needs. You know your project the most, so you should be able to set your own desired folder structure. You should be able to select which extensions you want to have pre-installed. And that, my amigos, is how Yiinitializr was born!


Yiinitializr is technically still in beta (?). Why? Because we believe that we need your feedback, yes you, from the Yii community, to make Yiinitializr right for all of us. You’re going to be using it, often (c’mon, you know you will…), so why not have a say in whether it’s enough or not… in what else it should or should not provide.

Okay, okay.. enough talk… now, let’s see how this baby works!

Yiinitializr is extremely easy to use. It is composed of only one page that will ask you three simple things:

1. What template type do you want to use? Basic, Intermediate or Advanced

Captura de pantalla 2013-04-13 a la(s) 00.05.32
2. Which extensions do you want pre-installed? Just search and select… really.. that’s all… no kidding… cool, huh?

3. Okay… maybe we misspoke… it’s really 3 steps; not questions. Download your finished project boilerplate!

4. What? Step 4? Maybe we can’t count, but you need to know what to do with the file you just downloaded, right? Well, here’s what you need to do:

Unzip, wherever you want your project to be, then (no, we are not going to tell you how to setup your database configuration. This is just a gentle reminder that you need to do that next…). Ahem… make your database configurations.
Now, run the following commands inside the unzipped project’s root:

// make sure you have the latest version of composer
php composer.phar self-update
// run your installation
php composer.phar install

Now, relax and love it! (or hate us, but keep it to yourself… really, all that negativity focused on us? We’re amigos! Come and share in the enchiladas… click on the docs below the templates to go to that github place and vent there…)

So, now you’re saying, “yeah, man… that is simple, but what are the template differences?”. We thought you’d never ask:

  • Basic: The small in scope project. Is your project just a frontend, or maybe a frontend with an admin interface? Well, this is the basic one, and it contains only /app and /www. Yes, you can still choose the extensions you want.
  • Intermediate: Your needs are maybe a little more complex than the basic offers, but you don’t want to go crazy. This one is closest to the structure you might be familiar with from YiiBoilerplate, but it’s much much lighter. Intermediate has a good solid structure. It contains: /backend, /common, /console and /frontend, and this structure will work for most of your robust applications. Need more?
  • Advanced: Now you’re talking! The advanced structure adds on the /api directory for your web services. Need we say more? Got ideas of world domination? It starts here! 😉

“But I want more details!” Yes, we agree, and this a great point to start the share of some knowledge. We know that once you download any of the template boilerplates you’ll start wondering what’s going on here. What the heck is this way of initializing applications? Check out the yiic.php or the index.php scripts within any of the application’s folder. See what we are doing. There is another surprise extension within, the Yiinitializr components. A set of classes that makes for a really easy way you can configure and install a project.

More documentation and discussion will be coming… we promise. We just wanted to let you play and react a little, first.


18 thoughts on “Yiinitializr: Maximum acceleration for your Yii project start!

  1. Hi, i’am new to YII and wanted to know which extension do you recommend to use for user management with yiinitializer. Thanks in advance.

  2. YiiBooster has nothing to do with Yiinitializr. YiiBooster is a library widget that is currently supported by Clevertech… I left the project for YiiWheels and Yiistrap, the new generation library of yii-bootstrap.

    Yiinitializr is a project template service to suit different needs according to the type of project that is also working in conjunction with Composer.

  3. Hi Antonio,

    I’m totally new with Yii. I stumbled with your yiinitializr few days ago and I got interested with it. Now I have already downloaded the finished project boilerplate, what should I do next?

    Thanks in advance!

  4. Hi Tony, I’ve been using it for development. Once you want to deploy it to a server, how do you tell the app that it should go and look for certain database configuration? I’m pretty lost. I’ve tried several approaches, but I don’t feel they are ok

  5. WOW
    Thank you! I have a question about the migrations process for external exstensions. for example i try to install and migrate the database with console for the yii-user and yii-auth. What i need to do?
    Thank you

  6. Thank you a lot Antonio Ramirez.
    Yiinitializr will help us. We played more and we need more documentation :).

  7. Hola Antonio,

    Estoy usando tu template, y tengo una duda. En el backend creo un gestor de contenidos en el cual se pueden subir imágenes, que luego se mostrarán en el frontend. No sé muy bien en cuál carpeta guardar las imágenes subidas desde el backend, si en el backend o en el frontend y luego como establecer la ruta.

    Un saludo y muchas gracias por compartir tanto código bueno!

  8. Yo lo que hago es tener un ALIAS en tu backend que me guarde las imágenes en el “img/uploads” del frontend (o como quieras llamar a la carpeta donde puedes ESCRIBIR tus subidas) lo único que debes hacer es que si las guardas en la base de datos, guarda sólo el nombre del archivo y para acceder a ellos, usa un nuevo alias en la configuración de tu frontend.

  9. Muchas gracias Antonio, para mí es un placer leerte en español…!
    Cierto los links de la web, en casa del herrero, cuchillo de palo…

    Me pareces un genio y muy generoso compartiendo código con el mundo.!

Leave a Reply

Your email address will not be published. Required fields are marked *