Wiki articles

Showing 281-300 of 823 items.

Extending CActiveForm for some form display fixes and language tweaks

Created 14 years ago by Trejder, updated 14 years ago by Trejder.

In this simple example I'll demonstrate how to extend CActiveForm class to overload some drawing functions to achieve some commonly used fixes in forms.

The colon

Here is overloaded version of CActiveForm.labelEx that adds colon (:) at the end of text of label with respecting CHtml::$afterRequiredLabel and CHtml::$beforeRequiredLabel

5 0
6 followers
Viewed: 25 510 times
Version: 1.1
Category: Tips

Use CGridview to sort and filter CSqlDataProvider - when used with UNRELATED tables (or complex queries)

Created 10 years ago by Gerhard Liebenberg, updated 10 years ago by Gerhard Liebenberg.

I have two tables called hospitals and departments. I have a junction table between them which holds the departments in each hospital. But sometimes I need a list of "All hospitals with All possible departments" - regardless of whether they are linked in the junction table or not.

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

Manage Email Template content from database

Created 10 years ago by Ankit Modi, updated 10 years ago by Ankit Modi.

Hi Friends,

0 1
1 follower
Viewed: 25 647 times
Version: all
Category: Tutorials

BootProgressColumn - Progress Bar Inside GridView Column compatible with 'bootstrap' extension

Created 13 years ago by Luiz, updated 12 years ago by robregonm.

A little hint of how to create a progress bar inside the column of the grid, using the 'bootstrap' extension.

5 0
7 followers
Viewed: 25 697 times
Version: 1.1
Category: Tips

Role Management

Created 10 years ago by Dency G B, updated 10 years ago by Dency G B.

Implementing a role based access control is a very easy process and you can even load your roles from the database if you want.

0 0
5 followers
Viewed: 25 698 times
Version: 2.0
Category: How-tos
Tags: rbac, yii2

Using Grunt for deploying client scripts

Created 12 years ago by Chris83, updated 12 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: 25 958 times
Version: 1.1
Category: How-tos

Managing a star rating with the StarRating widget in Yii 2

Created 11 years ago by Kartik V, updated 11 years ago by Kartik V.

In Yii 1.x, there was a built in widget CStarRating based on the jquery star rating plugin. There exists no prebuilt solution in Yii2, however the same concepts can be extended using any jquery plugin.

1 3
41 followers
Viewed: 26 062 times
Version: 2.0
Category: How-tos

How to store array/widget configuration to the database with config validation rules

Created 11 years ago by Kartik V, updated 11 years ago by Kartik V.

Note the tag {{homeUrl}} will be dynamically replaced at runtime.

2 3
41 followers
Viewed: 26 150 times
Version: 2.0
Category: Tutorials

Using sub query for doubletts

Created 12 years ago by mb, updated 12 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: 26 163 times
Version: 1.1
Category: Tips

How To: Custom Client Validation On Checkbox Toggle and Optional Input Field

Created 9 years ago by Wade Shuler, updated 9 years ago by Wade Shuler.

I just chased my tail around for a bit today. I got lost with setting the status of all inputs, and banging my head on why the "validate" function just wasn't working.

0 0
1 follower
Viewed: 26 175 times
Version: 2.0
Category: How-tos

How to hide `index` action from URL

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

Here is my experiment inspired by my own question and others from the forum.

3 1
9 followers
Viewed: 26 205 times
Version: 1.1
Category: How-tos
Tags: index

Facebook DeAuthorize callback URL and its response data.

Created 12 years ago by sirin k, updated 8 years ago by Maurizio Domba Cerin.

Facebook Deauthorize callback is used to getting notification to the app owner when a user uninstall our app from their fan page or profile.

3 0
6 followers
Viewed: 26 234 times
Version: 1.1
Category: Tutorials
Tags: facebook

Update CGridview row separately using ajax request

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

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

5 0
8 followers
Viewed: 26 300 times
Version: 1.1
Category: How-tos

How to log context information to logger (session id, user, ...)

Created 16 years ago by olafure, updated 13 years ago by ajsharma.

Logging context information (session, user, ...) to the logfile can be of great help tracking down problems with specific users.

2 0
5 followers
Viewed: 26 316 times
Version: 1.1
Category: Tutorials
Tags: Logging

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

Created 13 years ago by pckabeer, updated 13 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: 26 372 times
Version: 1.1
Category: How-tos

How to get & store Last Login DateTime in database?

Created 10 years ago by Rohit Suthar, updated 10 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: 26 488 times
Version: 1.1
Category: How-tos

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

Created 12 years ago by Boaz, updated 8 years ago by mrun.

Consider the following use case:

5 1
6 followers
Viewed: 26 622 times
Version: 1.1
Category: How-tos

How to re enable logging during unit testing

Created 13 years ago by Asgaroth, updated 13 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: 26 763 times
Version: 1.1
Category: How-tos

How to use yii2-authclient to communicate with Twitter using Single Access Token

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

It is quite simple, but I am sure this small tutorial will help more than one of you out there :)

2 0
4 followers
Viewed: 26 793 times
Version: 2.0
Category: How-tos

Sub-domains with different databases in Yii!

Created 14 years ago by jwerd, updated 14 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: 26 891 times
Version: 1.1
Category: How-tos