Wiki

Articles in category "how-tos", sorted by viewsX
Displaying 71-80 of 301 result(s).

Simple authorization system

Created 2 years ago by GustavoHow-tos1 comment – viewed 23,378 times – ( +16 ) – version 1.1
How to create a simple (non-RBAC) authorization system

How to use nested DB transactions (MySQL 5+, PostgreSQL)

Created 5 years ago by mindehHow-tos5 comments – viewed 23,069 times – ( +42 ) – version 1.1
Original source code and idea are from: PHP, PDO & Nested Transactions.

How to use an application behavior to maintain runtime configuration

Created 3 years ago by zaccariaHow-tos3 comments – viewed 22,916 times – ( +27 ) – version 1.1
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.

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

Created 2 years ago by c@cbaHow-tos2 comments – viewed 22,529 times – ( +14 ) – version 1.1
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).

Integrating HybridAuth directly into Yii without an extension

Created about a year ago by biz devHow-tos7 comments – viewed 22,275 times – ( +14 ) – version 1.1
This article tries to explain the steps required in integrating the HybridAuth into Yii directly, without using an extension.

Authenticating against phpass hashes with Yii

Created 2 years ago by Da:SourcererHow-tos18 comments – viewed 22,219 times – ( +26 ) – version 1.1
Note: This guide is outdated as of Yii v1.1.14 which introduced the CPasswordHelper class. Please use that instead.

Single table inheritance

Created 3 years ago by samdarkHow-tos6 comments – viewed 22,159 times – ( +38 ) – version 1.1
Relational databases do not support inheritance so if we need to represent it, we have to somehow store meta info while keeping performance by minimizing JOINs. One way to solve this problem is using single table inheritance. All fields for the whole class tree are stored in a single table. Class name is stored in the type field of the same table.

Kickstart development with Yii-App

Created about a year ago by Chris83How-tos24 comments – viewed 21,774 times – ( +21 / -1 ) – version 1.1
I recently created a project called Yii-App on GitHub to kickstart my development of smaller Yii applications. The main goal of the project is to provide a ready-to-use application template that includes my bootstrap extension and many other useful extensions. After reading this article you will be able to use this project as a starting point for all of your Yii projects.

Keeping a running total in a CGridView

Created 3 years ago by Steve FriedlHow-tos4 comments – viewed 21,696 times – ( +24 ) – version 1.1
This tip created in conjunction with IRC #yii channel users emilsedgh and tydeas - thanks!
tags: CGridView

Dynamic Sidebar using CClipWidget

Created 3 years ago by SheldmanduHow-tos5 comments – viewed 21,555 times – ( +21 ) – version 1.1
Most applications will have one or two sidebars and often you want to control the content that should appear in the sidebar based on the action. For example you will want to show something different on the homepage as opposed to some view page. While achieving this you generally also want to avoid putting the layout into each view, as that would mean if you wanted to change the layout (e.g. put the sidebar on the left instead of the right or do some funky layout which requires an additional div tag to be added) you'd have to go through every view, which does not achieve good code re-use. It is also bad practice to have lots of if statements in column2 layout just so that you can generate the sidebar correctly.