Wiki articles

Showing 241-260 of 651 items.

How to get & store Last Login DateTime in database?

Created 9 years ago by Rohit Suthar, updated 9 years ago by Rohit Suthar.

In this wiki I will show how could be store last login date & time in database. First we need a field LastLoginTime (Type must be datetime). this field store a user login detalis (like - Date & Time).

2 0
4 followers
Viewed: 24 910 times
Version: 1.1
Category: How-tos

Using Grunt for deploying client scripts

Created 11 years ago by Chris83, updated 10 years ago by Chris83.

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...

8 0
7 followers
Viewed: 24 966 times
Version: 1.1
Category: How-tos

Using sub query for doubletts

Created 11 years ago by mb, updated 11 years ago by mb.

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();

3 0
10 followers
Viewed: 24 988 times
Version: 1.1
Category: Tips

Radio Button List with enum values for column of type ENUM >+> incorporate into giix

Created 11 years ago by pckabeer, updated 11 years ago by pckabeer.

Let's say our table 'mug' has a column named 'color' of the type ENUM('red','green','blue').
We want to replace the textfield for the attribute color in the create and update forms of a 'mug' with a Radio Button List, which has the enum values as options.
This is a rewrite of c@cba in the wiki article of [enumDropdownList](http://www...

6 0
3 followers
Viewed: 25 076 times
Version: 1.1
Category: How-tos

Update CGridview row separately using ajax request

Created 9 years ago by Kostas Apazidis (KonApaz), updated 9 years ago by Kostas Apazidis (KonApaz).

There are cases you want to update a record on CGridview directly

5 0
8 followers
Viewed: 25 085 times
Version: 1.1
Category: How-tos

embed a view file of the class which implement the CAction.

Created 13 years ago by Davidhhuan, updated 13 years ago by Davidhhuan.

In Yii, we can define an action class and ask the controller to instantiate it. And we always create ourselves actions class in rootPath/protected/extensions, and the view file we called in the actions class always are located in rootPath/protected/views/ControllerNAME or rootPath/themes/ThemeNAME/ControllerNAME, then when we use the same actions class in different controllers, we have to copy it...

1 1
2 followers
Viewed: 25 137 times
Version: 1.1
Category: Tutorials

How to re enable logging during unit testing

Created 12 years ago by Asgaroth, updated 12 years ago by Asgaroth.

Some of you have experienced the need to log some information while doing unit testing, due to the fact that the information given in the summary is just not enough, to know why the test is actually failing. this article focuses on 2 ways to get you logs up and running again.

11 0
10 followers
Viewed: 25 498 times
Version: 1.1
Category: How-tos

How to "masquerade" a non-required form element as 'required' one (in the view only)

Created 11 years ago by Boaz, updated 7 years ago by mrun.

Consider the following use case:

5 1
6 followers
Viewed: 25 534 times
Version: 1.1
Category: How-tos

Background task with Ajax

Created 8 years ago by Alexandre Rodichevski, updated 8 years ago by Alexandre Rodichevski.

This article discusses how one can run a long task in background in yiiframework 1.1 using Ajax technique.

0 0
1 follower
Viewed: 25 549 times
Version: 1.1
Category: Tutorials

Sub-domains with different databases in Yii!

Created 12 years ago by jwerd, updated 12 years ago by jwerd.

I used another example posted here a while back where the person was modifying the index.php and adding in a switch case for different domains and loading separate config files. This was actually too much for me, because all my portals are the exact same (as far as routes, modules, extensions, etc) and if I ever wanted to add another route it wouldn't be feasible opening up all the config files t...

2 0
12 followers
Viewed: 25 737 times
Version: 1.1
Category: How-tos

Google style sign out of all other sessions

Created 9 years ago by Rohit Suthar, updated 9 years ago by Rohit Suthar.

In this wiki I will show how could logout from all other sessions or all other places.

0 0
5 followers
Viewed: 25 947 times
Version: 1.1
Category: How-tos

Yii 1.1: How To add id or class to CMenu items ?

Created 9 years ago by Louis Gac, updated 9 years ago by Louis Gac.

CMenu comes with a lot of great customization options built in. One of the most used is the class 'active' being added to menu item. But, what if you want to add your own class or id to a menu item ?

1 0
1 follower
Viewed: 26 001 times
Version: 1.1
Category: How-tos

Impersonate Users within Yii Framework

Created 13 years ago by Woil, updated 13 years ago by Woil.

For some applications it can be advantageous for administration reasons to allow site administrators to login as other users. This is sometimes called user impersonation or "becoming that user".

20 0
21 followers
Viewed: 26 249 times
Version: 1.1
Category: Tutorials

How to avoid a database update if the ActiveRecord was not modified

Created 10 years ago by tomvdp, updated 9 years ago by tomvdp.

The classic Yii way for doing an update action is as follows:

1 0
3 followers
Viewed: 26 295 times
Version: 1.1
Category: How-tos

Yiinitializr: The Library

Created 11 years ago by Antonio Ramirez, updated 11 years ago by Antonio Ramirez.

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(); `

Yiinitializr\Cli namespace

This namespace brings utilities to interact with...

14 0
23 followers
Viewed: 26 504 times
Version: 1.1
Category: Others

Adding a link to a CDataColumn

Created 11 years ago by le_top, updated 11 years ago by le_top.

Backoffice Grid Views often list information like Posts for a blog while showing at the same time linked information like the User who wrote that post. For more efficiency, it is appropriate that the User is displayed as a link to the User detail page.

2 0
8 followers
Viewed: 26 568 times
Version: 1.1
Category: Tips

Avoiding duplicate script download when using CActiveForm on Ajax calls

Created 12 years ago by Antonio Ramirez, updated 12 years ago by Maurizio Domba Cerin.

The only thing required is simple, we just need to create a view that will be partially rendered by a call to a controller (using renderPartial) and make sure that we process output -setting to true the parameter on the function. Everything will work as expected but...

11 1
9 followers
Viewed: 26 605 times
Version: 1.1
Category: Tutorials

Changing Controllers Name

Created 13 years ago by Trejder, updated 10 years ago by Trejder.

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.

4 0
2 followers
Viewed: 26 615 times
Version: 1.1
Category: How-tos

Extension Development (beginner)

Created 10 years ago by sefburhan, updated 10 years ago by CeBe.

To extend the functionality of you web application relative to your requirements you are supposed to use existing yii core libraries or use external libraries. There are some steps to ensure security, uniqueness, modularity, performance and to avoid rework in future.

Step 01: Have a Strategy

  • Is my extension just for fun/demonstration purposes or for everyday use in the real world? -...

Generate a multi-lever array sub-category for a menu

Created 10 years ago by Kostas Apazidis (KonApaz), updated 9 years ago by Kostas Apazidis (KonApaz).

Everyone have seen a multilayer menu in several CMS

7 0
8 followers
Viewed: 26 978 times
Version: 1.1
Category: How-tos