Improved advanced and basic templates are released!

Hello everyone!

I am happy to present you my yii2 application templates. They are free and hosted on GitHub and Yii extensions page. You can download them using composer. Installation instructions as well as feature listings are given on GitHub extensions pages.

Advanced: Page for advanced template

Basic: Page for basic template

Templates have more features than default ones and they are shared hosting friendly.

One of the features is “Registration with activation”. When user signup he will have to activate his account using email activation system before he can log in ( you can chose whether or not you want to use this ). Since most of the people do not have email server set up on their computers ( like me :) ), I made a demo app on freetuts.org where you can try this signup with activation, Click here to see it. Hosting company where I am hosting freetuts.org website does have email service provided, so you can test this functionality on my web site. Just signup and activate your account using your email provided.

If you have any questions, you can post them here, or contact me using contact form on freetuts.org

P.S. Thank you all for your kind words and support!

Does it redirect request to web folder in shared hosts? I mean if user clicks example.com will be forwarded to example.com/web/index.php

Look at the structure, there is no web folder. So yes, when user clicks example.com, he will get example.com (example.com/site/index)

Even in advanced template, frontend side of application is accessed like that (example.com is frontend). Backend is just example.com/backend :)

Even further, for security and other reasons you can move _protected folder outside of the web root if hosting company allows you that. That will leave only publicly accessible files in web root, like entry script index.php and assets…

There was some small update to these templates. Current version is 1.0.1

Update fixes some small css issue and some code comments. You can not automatically update application templates, but if you download new ones, you will have these fixes because you will get version 1.0.1.

Cheers :D

Nice work man!!

Thanks :D

I will take a look but it sounds great. Congrats.

One question, why did you change Yii structure (default) to this new one?

  1. It requires less work in order to get what you want, especially in shared hosting environment where your options may be limited.

  2. You can easily move sensitive (protected) data outside of the web root.

Less configuration, more convenience, everything is working out of box :)

Cool, I’m going to give this a try soon.

Nice work! Just been playing around with it and it’s taken all the setup work away that i would have had to implement, pretty url, login, session etc. Love the new folder layout too, it’s the one thing i wasn’t keen on with the current advanced template.

I’m going to carry on testing and using this one as the basis for my first yii2 portal… will comment here if i find anything!

I just installed the improved advanced template and I think it’s really great. Everything worked out of the box. However, I have 2 questions: regarding the templates, I’m wondering how to set different layouts for different themes. The way I did it right now, for the frontend, is by having different files in the “_protected/frontend/views/layouts” folder (main_default_cool.php, flat_theme.php) and I copy the one I need to main.php, after I set the desired one in the frontend main config file.




'view' => [

            'theme' => [

                'pathMap' => ['@app/views' => '@webroot/themes/flat_theme'],

                'baseUrl' => '@web/themes/flat_theme',

            ],

        ],



My second question is about the migration tables created on installation. Can I set a prefix (yii_) to all of them without the risk of having everything broken in an eventual update with composer? I’d like to rename all of teh tables and add “‘tablePrefix’ => ‘yii_’,” in th “db” section of my main config file.

thanks a lot!

  1. Inside your flat_theme folder create views folder, and inside views create layouts folder. Put your layout there (you will have to call that layout "main.php"). Then in your config tell your pathMap to load your views from your theme:



'pathMap' => ['@app/views' => '@webroot/themes/flat_theme/views'],



  1. You do not need to touch migrations at all. Just before you run them, inside your db config set table prefix to what you want. THEN you run migrations, and all tables will be created with your desired prefix.



'tablePrefix' => 'yii_'



Thank you very much Nenad. I did exactly that and it worked perfectly. I knew that my solution was less than optimal but I just missed the need to create those 2 subfolders.

BTW, congratulations for that great work!

Kraken is released ! :D

New update 1.1.1 has been released! In this update I have included new feature: password strength extension. Also a lot of small tweaks has been made, to make everything perfect and polished.

You can read more about password strength in guide that I have written on extensions page: HERE , and you can see demo on demo.freetuts.org.

This password strength extension is based on Kartiks yii2-password. I wanted to include his version in template, but the problem was that his extension is requiring some other extension which in turn require other extensions, and make it in total of 7.7 MB of downloaded code when installed. Since I wanted to make templates as slim as possible, I decided to fork his extension and optimize it to be used as a core part of improved templates. Thanks to that only necessary extensions are included and they take only 174 KB of space. Even further, inside yii2-widgets-base extension (in vendor/nenad), you will have amazing AssetBundle class made by Kartik, that you can use and abuse when developing your extensions or customizing Kartiks ones. That will cut the amount of dependencies considerably!

This version 1.1.1 is very polished now, and will probably remain unchanged for a long time (will be updated if necessary), so you can start using it for your long term projects ! It has all features I wanted them to have, everything is nice and polished and ready to go!

Upgrading your current applications to version 1.1.1:

Unfortunately since this is an application template you can not update it automatically using composer update. You will have to download the new one, and copy-paste your existing code there.

Thank you all for your kind words and support! This was a great adventure for me, and party will not stop here. In few days, after I rest a bit, I will start developing blog template that will be based on improved advanced template. After that comes e-commerce ! :D

[b]

To be continued…[/b]

Nice !

Thanks for your work

Jok

I downloaded your template last night, it seems to have the password strength indicator on it so must be the latest.

It did’nt work right off the bat for me. I am new to yii but not php. I had to enable the apache settings allowoverride All and enable modrewrite. It took about an hour of messing about to figure this out so maybe you should stick those little hints in download page.

A couple questions:

Why do you only allow admins to modify their own templates? Surly admins should have total control over every user below them. I disabled that bit easy enough, but need to be able to deactive users at will. Where do I start going about doing this?

I want to install Jquery mobile as the frontend theme but leave bootstrap as the backend theme. Where do I start with this? Is it something I can do with composer or will I have to manually create a theme?

  1. It is not always good idea to give power to admins to modify/use other people data. Do that only if you are sure that you need it and your clients request it. For example, one IT company had a huge problem, because their clients (dating site) was doing something really bad with their users accounts. Actually one of the admins was abusing something. I can not really tell you what because I do not want to get sued or something. What happened was that users of that dating site sued the site because of bad thing that happened to them, and admins of the site was blaming IT company. If you need functionality you mentioned above, implement it yourself. This is just application template.

  2. Read the Assets guide

yeah I every intention of implementing it myself, just trying to figure where to start, I assume user activation is some kind of asset or widget?

I am guessing jquery mobile is an avaiable asset. I just need to understand themes.

The documentation is good but not always that streightforward to understand espcially if you have came from codeignitor.

What do you mean by user activation ? I do not understand you.

jQuery mobile has nothing to do with yii2, if you need to implement it, do it like in any other framework. Asset guide will explain you how to work with any assets (js, css…) in you application. I have feeling that you are expecting to find some widget/extension that will do all the work for you… you can’t… at least not at this moment.

Sorry what I mean by user activation is:

In your template you have an email verification system that requires the user to authenticate via email after they register. Once the user has done this in the backend the user status becomes Active. I am going to modify it so that I can deactive a user so that they can no longer log in. But their account will still exist and can be reactived later. Its this user authentication in your template a widget or extention of some sort or did you custom code it?

Ok as for jquery mobile thats fine, I just thought it might be avaiable as something I could install without having to do it manually I guess not.