Wiki articles in category How-tos

Showing 121-140 of 292 items.

Email by YiiMailer, Call Outlook, IMAP

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

In Yii community we have lots of extention can send emails, such as YiiMailer and Swift and so on, or even IMAPI, thanks for team contribution. However, sometimes, in the intranet enviroment, the program cannot run successfully since SMTP /IMAP port been banded. So you need to seek other ways. The most simple way is call outlook as COM.

0 0
6 followers
Viewed: 19 416 times
Version: 1.1
Category: How-tos

How to create a simple logout link in the view?

Created 10 years ago by mi.sarah, updated 10 years ago by CeBe.

Here you learn to create and set a simple ahref-link to logout the current user.

0 2
1 follower
Viewed: 47 365 times
Version: 1.1
Category: How-tos

How to limit number of guest page views

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

In some cases, we have to limit the number of page views for the guests users. Yii provide an efficient method to get this.

2 0
5 followers
Viewed: 8 970 times
Version: 1.1
Category: How-tos

Attaching multiple event handlers to onBeginRequest

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

There came the need to perform two operations, always, on 'application boot' time. Example? My real world example involved some geo-location logic (that's the first operation) and syncing of some session details so KcFinder can be in sync with the user in context - each user with his own session container (the second).

1 0
2 followers
Viewed: 15 478 times
Version: 1.1
Category: How-tos

Simple example for language translation

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

Language translation is a common requirement in multi lingual sites. In Yii, we can translate using message and view translation.

1 0
5 followers
Viewed: 37 442 times
Version: 1.1
Category: How-tos
Tags: i18n, Yii

Safely checking if a model class exists (without exploding)

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

While rewriting the PcReportContent extension I'm maintaining I've bumped to a challenge. This wiki was born out of it.

1 0
2 followers
Viewed: 17 579 times
Version: 1.1
Category: How-tos

How to Enhance a CGridView

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

by: Christian Salazar (bluyell, @salazachris74, christiansalazarh@gmail.com)

2 0
5 followers
Viewed: 11 494 times
Version: 1.1
Category: How-tos

Select2 Infinite Scroll With Remote Data in Yii

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

I was able to set up the infinite scroll of select2 in Yii. I am glad to share it with you. The demo and source code can be found here. However, select2 for Yii can be found here which uses a widget.

3 0
5 followers
Viewed: 21 464 times
Version: 1.1
Category: How-tos

Localized version of CFormatter

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

To replace the application component 'format', which is registered by CApplication by default, you can put this in your application 'components' config:

2 0
5 followers
Viewed: 10 116 times
Version: 1.1
Category: How-tos

Using CJuiDatePicker for CGridView filter

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

We can use a CJuiDatePicker for a CGridView inline filter.

19 0
31 followers
Viewed: 63 642 times
Version: 1.1
Category: How-tos

Syncing sessions between Yii and KCFinder

Created 11 years ago by Thanasis Fotis, updated 10 years ago by Boaz.

>Info: As KCFinder's documentation mentions, if your application (Yii in our case) session handling is using the PHP environment configuration - meaning no change in session handling at all, then no change is needed also on KCFinder side to be able to use this session and thus have this simple interface between your Yii webapp and KCFinder. If t...

1 0
6 followers
Viewed: 16 522 times
Version: 1.1
Category: How-tos

Configuring controller access rules to default-deny

Created 13 years ago by Steve Friedl, updated 10 years ago by nsanden.

Starting with the blog tutorial, Yii developers are familiar with the notion of access rules defined in the controller, where the actions are allowed or denied depending on the user's name or role.

class CommentController extends CController {
    public function filters()
    {
        return array( 'accessControl' ); // perform access control for CRUD operations
    }

11 0
12 followers
Viewed: 105 354 times
Version: 1.1
Category: How-tos

Getting the Most out of APC for Yii

Created 12 years ago by Da:Sourcerer, updated 10 years ago by Da:Sourcerer.

In addition to the opcode cache, APC can also serve as a user cache for Yii via [CApcCache]. It should be noted that this will make APC's memory needs less predictable.

15 0
19 followers
Viewed: 49 075 times
Version: 1.1
Category: How-tos
Tags: apc, caching

Dynamic Sidebar using CClipWidget

Created 13 years ago by Sheldmandu, updated 10 years ago by Cozumel.

There are a couple of ways to achieve this, but the first is preferred.

18 0
18 followers
Viewed: 53 741 times
Version: 1.1
Category: How-tos

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 257 times
Version: 1.1
Category: How-tos

jQuery UI Datepicker

Created 11 years ago by softark, updated 10 years ago by Shahcheraghean.

We all love the convenient gadget, namely jQuery UI Datepicker as an input element for date. Yii supports it as CJuiDatePicker. Let's see how to use it.

5 0
12 followers
Viewed: 97 045 times
Version: 1.1
Category: How-tos

Real-time display of server push data using Server-Sent Events (SSE)

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

Let's say you have an internal messaging system in your webapp, and you want to display messages dynamically and real-time to the relevant recipients.

9 0
17 followers
Viewed: 63 482 times
Version: 1.1
Category: How-tos

defaultScope

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

This example includes a composite condition as well as an empty condition - as if you bypass or disable defaultScope without using resetScope().

3 0
5 followers
Viewed: 33 005 times
Version: 1.1
Category: How-tos

Reference: Model rules validation

Created 14 years ago by krillzip, updated 10 years ago by Rodrigo.

This is a reference to be used for Model rule validation and is compiled from the Yii documentation and code. The purpose is to have all the information gathered in one place instead of scattered. This reference is not an intro. See The Definitive Guide to Yii, Declaring Validation Rules for a tutorial.

99 0
114 followers
Viewed: 884 926 times
Version: 1.1
Category: How-tos

Using filters with CGridView and CArrayDataProvider

Created 12 years ago by marcovtwout, updated 10 years ago by yugene.

Using filters on CGridView with CActiveDataProvider is easy, but with CArrayDataProvider it is a bit tricky.

19 0
29 followers
Viewed: 92 838 times
Version: 1.1
Category: How-tos