Wiki articles in category How-tos

Showing 161-180 of 292 items.

Extending an ActiveRecord model

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

protected $_viewFile

2 3
7 followers
Viewed: 28 736 times
Version: 1.1
Category: How-tos

How to create a Widget - Recent Comments widget

Created 9 years ago by Nisanth thulasi, updated 5 years ago by samdark.

Here's a simple way to create a Recent comments showing widget to be used in your templates. The idea is just to highlighting your blog's new comments.

5 0
6 followers
Viewed: 43 394 times
Version: 1.1
Category: How-tos
1 0
5 followers
Viewed: 10 792 times
Version: 1.1
Category: How-tos
Tags: i18n, Routing

How to use an application behavior to maintain runtime configuration

Created 12 years ago by zaccaria, updated 11 years ago by Pablovp.

In this tutorial will be explained a method to manage some configuration runtime. This excellent tutorial follows a similar approach, but requires to write a masterclass which all controllers are supposed to extend, following this wiki you can achieve the same by only editing the configuration.

26 0
25 followers
Viewed: 42 374 times
Version: 1.1
Category: How-tos
11 0
20 followers
Viewed: 32 890 times
Version: 1.1
Category: How-tos

Yet another implementation of CPhpAuthManager.

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

In this wiki, I try to implement a simple authorization schema without putting much logic inside a file or into database table. We are constructing authorization hierarchy inside the controller. We are getting roles for the current user from database table and assigning only roles to user that are declared in the particular controller. We have brought down the work of loading of auth data at ma...

5 1
7 followers
Viewed: 19 165 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 949 times
Version: 1.1
Category: How-tos

How to translate and do the translations the easy way

Created 12 years ago by Roman Solomatin, updated 8 years ago by Roman Solomatin.

I wanted to keep all the I18N related translations in separate files, so that I would not need to modify the view files or the model files every time I need to update or fix the translations of application's source language.

16 2
17 followers
Viewed: 87 515 times
Version: 1.1
Category: How-tos

Popup AJAX DialogBox without any extension

Created 10 years ago by Kostas Apazidis (KonApaz), updated 7 years ago by Maurizio Domba Cerin.

In this wiki I explain how to show a default popup dialogbox (like Gii does) using an existing module.

5 1
6 followers
Viewed: 30 441 times
Version: 1.1
Category: How-tos

"safe" and "unsafe" Model validators (massive assignments)

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

Ok, it is a little bit difficult to full understanding the unsafe validator.

2 2
7 followers
Viewed: 36 269 times
Version: 1.1
Category: How-tos

Multiple Database Connection : Select database based on login user id, Dynamic

Created 10 years ago by Rajith R, updated 9 years ago by parthshah.

create a class file under protected\components named RActiveRecord.php

6 0
12 followers
Viewed: 44 383 times
Version: 1.1
Category: How-tos

Visualization tree-multi subcategories as listbox or dropdownlist

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

Do you want to make a listbox or dropdownlist to select one or more categories or sub categories ?

4 0
4 followers
Viewed: 27 854 times
Version: 1.1
Category: How-tos

Tarpit for bad bots

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

I recently built a tarpit for bad bots.

1 0
9 followers
Viewed: 10 046 times
Version: 1.1
Category: How-tos
Tags: bots, tarpit

Drop down list with enum values for column of type ENUM >+> incorporate into giix

Created 12 years ago by c@cba, updated 10 years ago by nsanden.

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 drop down list, which has the enum values as options.
The main code was contributed by zaccaria in the forum (see [this post](...

10 0
11 followers
Viewed: 51 281 times
Version: 1.1
Category: How-tos

CGridView keep focus on the control after filtering

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

You can find the reason why I wrote this article here.

5 0
10 followers
Viewed: 17 017 times
Version: 1.1
Category: How-tos

Simple Share Widget for Facebook, twitter and google+

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

This widget will show a Facebook "like" button and "comments" box together with "tweet" button and "google plusone" button on your page.

10 0
16 followers
Viewed: 32 360 times
Version: 1.1
Category: How-tos

Simple Web APIs for your Yii App

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

Its very common now-a-days to have Mobile app for web apps. For Mobile apps we need web APIs to fetch data or even post/update on web. We found a very simple method to make such interface. Mobile App can call plain get or post request and receive data back in JSON format. JSON is relatively easy for mobile app to handle while plain standard GET/POST request for easy for Web server to handle. This...

1 2
10 followers
Viewed: 32 573 times
Version: 1.1
Category: How-tos
Tags: API, JSON

Using standard filters in CGridView custom fields

Created 13 years ago by GOsha, updated 13 years ago by jwerner.

In this article I'll try to explain how to use standard quick search fields in CGridView with customized columns.
For example:
We have a record in a database with field switch having 0 or 1 values. After that we want a user to see on or off instead 1 or 0.
So we do the usual thing:

<?php $this->widget('zii.widgets.grid.CGridView', array(
//.....
array(
    'name'=>'...
14 0
16 followers
Viewed: 74 082 times
Version: 1.1
Category: How-tos

Integrating Wordpress and Yii,Working Out The Details.

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

First things first,follow the instructions in fr0d0z's article to set up WordPress.Regarding the WpController,I did not use an index view.So the code for WpController is

class WpController extends Controller
{
    public function init()
    {
	 // note that we disable the layout
        $this->layout = false;
        parent::init();
    }

7 0
13 followers
Viewed: 33 629 times
Version: 1.1
Category: How-tos
Tags: wordpress

Elementary introduction to using jQuery ajax and the yii framework

Created 11 years ago by dhimes, updated 11 years ago by François Gannaz.

In doing internet searches trying to learn how to incorporated ajax into web pages generated by the yii framework I noticed that there seems to be a lot of confusion. I worry that too-clever hacks will be broken in upgrades of the framework.

2 0
15 followers
Viewed: 53 169 times
Version: 1.1
Category: How-tos
Tags: AJAX