Wiki

Articles in category "how-tos", sorted by viewsX
Displaying 81-90 of 341 result(s).

Single table inheritance

Created 4 years ago by samdarkHow-tos8 comments – viewed 26,428 times – ( +40 ) – 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.

Simple authorization system

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

Keeping a running total in a CGridView

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

CGridView. Add custom class to table rows preserving original „odd“ and „even“

Created 2 years ago by Maug LeeHow-tos2 comments – viewed 25,608 times – ( +8 ) – version 1.1
Lets say we have such a CGridView widget showing a list of users for administrator. Users have status „active“ or „disabled“. Grid widget puts class „odd“ or „even“ to rows and we want to preserve this. So we want to add a class „disabled“ to rows with disabled users.

Run Yiic directly from your app without a shell

Created 3 years ago by jacmoeHow-tos6 comments – viewed 25,459 times – ( +18 ) – version 1.1
Sometimes it would be nice if we could run yiic from an action, for example a migrate database button in our admin panel. Or because you are on a host which doesn't have shell access. Or maybe you are not allowed run popen or exec.

Storing your images in your table's blob field and displaying that stored images.

Created 3 years ago by sirin kHow-tos7 comments – viewed 25,437 times – ( +9 / -1 ) – version 1.1
He im giving you a very simple example ie how you can store an image to your blob field in a table.Hope you already familiar with the normal image upload.
tags: blob, image

URL management for Websites with secure and nonsecure pages

Created 2 years ago by qiangHow-tos12 comments – viewed 24,772 times – ( +27 ) – version 1.1
In this article, I will describe how to manage URLs for a Website that has both secure and nonsecure content.
tags: URL

Authenticating against phpass hashes with Yii

Created 3 years ago by Da:SourcererHow-tos18 comments – viewed 24,532 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.

Dynamic Sidebar using CClipWidget

Created 4 years ago by SheldmanduHow-tos5 comments – viewed 24,080 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.

Open bootstrap modal and load content via Ajax

Created about a year ago by JbalTeroHow-tos1 comment – viewed 23,799 times – ( +3 ) – version 1.1
My goal here is to Open bootstrap modal and load ANY content using ajax response.