This tutorial assumes some basic knowledge of Yii and a functional development environment.
This tutorial assumes some basic knowledge of Yii and a functional development environment.
The basic idea is to create a complete mail message and store it a Db table along with all info necessary for sending valid emails (to_email, from_email, from_name, subject etc.)
The scenario in which this wiki can be useful is when you have to send an (huge) array of model ids and perform a time consuming computation with it like linking every model to other models. The idea is to split the array into smaller arrays and perform sequential ajax requests, showing the calculation progress using a [Bootstrap Progress bar](https://www.yiiframework.com/extension/yiisoft/yii2-bo...
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.
This is a tutorial to work with radioButtonList which will handle enum datatype. Form design and validation both are detailed here.
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).
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.
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.
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.
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 `...
Validators extending from [CValidator] all have a property named [message|CValidator::message]. You can set this property in the corresponding validation rule to customize the error message. For example, the following validation rule uses an error message that is different from the default one: