I have a Yii 1 website, but I am changing my business model and totally rebuilding a new site from scratch (might as well go Yii 2). I am wondering if the basic app will be sufficient. I am on shared hosting, I’m the only person writing code and the only one who needs admin privileges.
In Yii 1 I could restrict access to admin views with accessRules(). Could I do something similar in Yii 2 basic?
For one thing, the advanced app is meant to be deployed as an multi-host app for which you’ll have some difficulties with a shared hosting.
I’m now working on an in-house app on a local network which will have about 200 users. The app must implement a bit complicated role based access control system. And I selected Yii 2 and the basic project template as the starting block for it.
Am I doing right? Of course I am. I’m quite satisfied with the out-coming result.
I agree with @softark. For you project Yii basic is sufficient.
You shoud see the PHP host requirements, if it have PHP 5.4 or higher.
Yeah, you could do a restrict access to, in the DOC have an example to do it. Yii basic has an implementations using "hard-code" to do a login, but it you change easily to data base login.
I’ll post this here to save starting a new thread.
I am still a little confused about the difference between the basic and advanced app.
I am about to start a new project which will be the building of a site that will be in the same vein as that for an employment agency - there will be a separation in user types, most notably admin users and basic users (public viewers of the site). I will need a backend for the creation of new candidates, jobs etc so the idea is to have www.website.com and admin.website.com.
I am unsure of which template I should use. I might have missed it, but is there some user requirement that clearly separates one template from the other? The obvious requirement I have is access control and views/layouts. I am unsure if I should use the basic template or simply change layout files as per the controller being run?
U4EA, In your case you should choose Advanced template. This structure, is already separated in frontend and backend.
The template cam be changed for both structure (frontend/backend) separated. You can use a same model with both structure, olny use a common directory.
I have an advanced application in a shared webhost, but I put the files there by FTP. To make it point to frontend index, I created a index.php in the root using a redirecting meta.
I have gone over the documentation, and I am a little confused about how to recreate the access control which in Yii 1 included ‘admin’, ‘@’ and ‘*’. In Yii 2 I see ‘?’ for not logged in and ‘@’ for logged in. I don’t know if I’m supposed to customize the Access Control Filter to add ‘admin’ or just use a very simple RBAC with just admin, and everyone else for roles.
Also I read the part about password security, and would like very much to follow the guidelines therein. The guide shows bits of code that I am not sure where to put them.