Wiki

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

Single table inheritance

Created 3 years ago by samdarkHow-tos8 comments – viewed 26,112 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.

Kickstart development with Yii-App

Created 2 years ago by Chris83How-tos25 comments – viewed 26,078 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 4 years ago by Steve FriedlHow-tos4 comments – viewed 25,689 times – ( +24 ) – version 1.1
This tip created in conjunction with IRC #yii channel users emilsedgh and tydeas - thanks!
tags: CGridView

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

Created 2 years ago by sirin kHow-tos7 comments – viewed 24,955 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

Run Yiic directly from your app without a shell

Created 3 years ago by jacmoeHow-tos6 comments – viewed 24,859 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.

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

Created about a year ago by Maug LeeHow-tos2 comments – viewed 24,827 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.

Authenticating against phpass hashes with Yii

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

URL management for Websites with secure and nonsecure pages

Created 2 years ago by qiangHow-tos12 comments – viewed 24,243 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

Dynamic Sidebar using CClipWidget

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

How to use YiiBooster Bootstrap Gallery

Created 2 years ago by Antonio RamirezHow-tos4 comments – viewed 23,278 times – ( +4 ) – version 1.1
Since version 1.0.4, Yii developers can make use of the image gallery provided by Sebastian Tshan, a great javascript developer that has created some true gems like the jquery file upload plugin.