Wiki

Sorted by viewsX
Displaying 421-430 of 718 result(s).

Using CListView to display items next to each other (in columns)

Created about a year ago by thyseusTips4 comments – viewed 9,636 times – ( +11 )
When using CListView to display multiple views next to each other, we can use the $index variable inside the viewFile to achieve this. As far as i know there is no extension or out-of-the-box functionality for this, so we need to apply a little hack:

How to extend CFormatter, add i18n support to booleanFormat and use it in CDetailView

Created 2 years ago by c@cbaHow-tos3 comments – viewed 9,633 times – ( +9 ) – version 1.1
As you know, the CDetailView widget displays details of a single model. If no formatting is specified, boolean values that are stored in the database as 0 and 1, are represented in the detail view as 0 and 1. If formatted as boolean, they are represented as 'No' and 'Yes'. We want to add i18n support, so that Yes and No appear in the current language.

How to send emails using SMTP

Created 7 months ago by robregonmHow-tos0 comments – viewed 9,627 times – ( +4 ) – version 2.0
Follow @robregonm
tags: yii2, email, mail, mailer, smtp

Save and Display Date/Time Fields in different formats in Yii2

Created 7 months ago by Kartik VHow-tos10 comments – viewed 9,626 times – ( +28 ) – version 2.0
You would find having such a need in most Yii Projects. Your database needs a specific format to store date fields, while you may want to display it in different formats to the users on forms and other views.

Simple example for language translation

Created 9 months ago by RKAHow-tos2 comments – viewed 9,536 times – ( +1 ) – version 1.1
Language translation is a common requirement in multi lingual sites. In Yii, we can translate using message and view translation.
tags: yii, i18n

Getting nulls from database instead of empty strings

Created 3 years ago by samdarkTips2 comments – viewed 9,409 times – ( +13 ) – version 1.1
To get null from database instead of empty strings you need to set up your DB connection as follows:
tags: database, null

Como trasponer una lista creada con CHtml::checkBoxList

Created 3 years ago by rdjteamTips3 comments – viewed 9,328 times – ( +2 ) – version 1.1
En ciertas ocasiones tenemos que lidiar con el tema de colocar una lista de checkboxes para hacer una seleccion especifica como es el caso de los dias de la semana para un calendario, para esta labor tenemos el comando CHtml::checkBoxList(), revisando un poco el funcionamiento de este temos los siguientes parametros:

How to: use github for download yii, create new app, and store our modules or extensions.

Created 2 years ago by sensorarioHow-tos1 comment – viewed 9,248 times – ( +8 ) – version 1.1
Yesterday I've written a module for myself. Just an experiment. When I was feeling satisfied, I've created a repository on github, and pushed my code. My module and yii are on github. So I'll show you a "new" way to start our yii projects.
tags: github, git

How to use bizRules in standard accessControl filter

Created about a year ago by redguyHow-tos8 comments – viewed 9,114 times – ( +3 ) – version 1.1
I assume you are familiar with accessControl standard filter. It allows you to separate privileges to run some action from action code itself. There is however one problem with most common usage - you cannot use bizRules, at least based on some parameters passed to 'checkAccess' just because it is hard to pass them in accessRules() result.

How to use GridView with AJAX

Created 7 months ago by Antonio RamirezHow-tos1 comment – viewed 9,106 times – ( +9 ) – version 2.0
With the adoption of PJax on Yii2 things  have change quite a bit with GridView when it comes to work with them in AJAX mode. It will probably be confusing at the beginning, but then you will soon realize how powerful the new approach is.
tags: yii2, pjax, widget