This article shows a quick and easy way to implement flat user access control system. Flat means, that user access is controlled by level only, which is solution exactly opposite to complex RBAC access systems.
This article shows a quick and easy way to implement flat user access control system. Flat means, that user access is controlled by level only, which is solution exactly opposite to complex RBAC access systems.
If we take a look at the blog demo we have 3 major parts of our view rendering. They are:
This page explains how to implement an event and catch that event in a behavior.
In this wiki, I try to implement a simple authorization schema without putting much logic inside a file or into database table. We are constructing authorization hierarchy inside the controller. We are getting roles for the current user from database table and assigning only roles to user that are declared in the particular controller. We have brought down the work of loading of auth data at ma...
I guess this is a tip on how to execute some code before every action in a controller, because I will tell you how I did it and maybe you can use the idea in your project.
Yiinitializr\Helpers\Initializer::create('./../', 'frontend', array(
// will override frontend configuration file
__DIR__ .'/../../common/config/main.php', // merged with
__DIR__ .'/../../common/config/env.php', // merged with
__DIR__ .'/../../common/config/local.php' // merged with
))->run();
`
This namespace brings utilities to interact with...
find doubletts by db fields. in this example i will check doublets for 3 tabelfields (col1,col2,col3). so i will get a subquery with the condition, select and grouping of the tablefields. the having with COUNT() > 1 means: find all records more then one result.
$model=new MyModel('search');
$model->unsetAttributes();
This article shows one of possible ways to implement menu items (as well as links), which displays a progress / wait dialog and are redirecting browser to destination URL in the same time. This is especially useful, for links or routes that are know to be loaded for a prolonged period of time (i.e. getting a lot of data from database).
In this tutorial we will be setting up a content type to be ordered by weight using the JUI Sortable plugin.
This article tries to explain the steps required in integrating the HybridAuth into Yii directly, without using an extension.
I found a standard Yii app's protected
folder structure nearly perfect. With a few simple moves and a little bit change to the code, I managed to bring it to the level, which I found as fully perfect. I want to share my point of view, in case someone would like to use this structure as well.
This article explains how to easily turn standard text-line validation errors into beautifully and professionally looking Twitter Bootstrap's Popovers.
To fix issues with display of special language characters once and for all there's a solution: use Unicode UTF-8 everywhere. If everything is set up to use Unicode, you can use mostly every language in your application.
How to create a simple (non-RBAC) authorization system
This very short how-to presents steps required to change controller name. It is oriented for less experienced users, which are starting their journey with Yii, to avoid common newbie pitfalls.
Please join the party by adding your own favorite Yii programming errors. Be sure to leave at least a hint at the correction.
These newsletters have always been hard to create as regular web HTML is not properly read by web email interfaces and email clients. I thought that the simplest solution would be to use a web page that would serve as a web version of the newsletter and turn it somehow into newsletter HTML.
This wiki shall be considered deprecated since the Yii installer for composer has been discontinued.
For a long time I have struggled to find a suitable tool for doing server tasks such as compiling LESS files, concatenating and minifying of JavaScript files and copying the minified JavaScript files. While most of these tasks can be done with Yii extensions I would still not recommend using them because it requires you to include these extensions in your project, and therefore also deploying them...