This article tries to describe the practical techniques of searching by a HAS_MANY relation using ActiveRecord of Yii 2.0.
This article tries to describe the practical techniques of searching by a HAS_MANY relation using ActiveRecord of Yii 2.0.
This wiki has been replaced by Use crypt() for password storage.
If we want to set meta tags on a per page (controller-action) basis, we may use the clientScript application component.
If you want to add module based login to a site without using RBAC, please follow these guidelines.
This tutorial shows how to filter CListView items by AJAX, and it's compatible with disabled JavaScript users
In my case this has been done to filter users list
For each column of the CGridView, we can specify name
, value
, htmlOptions
, cssClassExpression
etc. In the declarations of the attributes value
and cssClassExpression
we can use the "special" variable $data
, for example like this: 'value'=>'$data->author->username',
.
Now we might want to use $data
in the declaration of the `...
I was wondering how to set-up the application parameters in the back-end to use them all around the application without the need of using the database and I came up with this solution, I hope it helps somebody else.
A simple trick to get the localized version of a model field is to add this little method to your models.
This is the first real problem that I encountered using Yii, trying to make a Model input repeatable in the form, validate and save them.
Yii does not have an LDAP class itself, but its very easy to implement LDAP in the stock UserIdentity class.
Here's a simple way to create a breadcrumb widget to be used in your templates. The idea is just to isolate how the breadcrumb is generated based on an array of crumbs.
This wiki is a work in progress.
It's well known that there are Lazy Loading approach and Eager Loading approach in the relational query. But it's very important to know how the Eager Loading approach works in Yii 2. It has changed drastically from that of Yii 1.1, and there are common misunderstandings about it in the community.
In order to nicely display flash Messages, create view like this called views/site/dialog.php :
CSRF is the acronymn for Cross-site request forgery.
It is an attack which forces an end user to execute unwanted actions on a web application in which he/she is currently authenticated.
Todos los que hemos empezado a utilizar Yii para crear aplicaciones Web, nos hemos dado de bruces cuando hemos intentado poner a funcionar el RBAC (acceso de control basado en roles).
It's well known that there are Lazy Loading approach and Eager Loading approach in the relational query. But it's important to note that you should distinguish 2 different modes in the Eager Loading in Yii 1.1.x.
In case of a multilingual application, one might consider it a reasonable approach to store the preferred language of the user in a session variable, and after that, every time a page is requested, to check this session variable and render the page in the indicated language.
This tutorial shows a Yii-way of doing this.
We implement an event handler for the onBeginRequest event; as the nam...
The most difficult thing in a big project, is to manage conflicts with files modified by others users. Git can do this work for us.
In this tutorial we will be setting up a content type to be ordered by weight using the JUI Sortable plugin.