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

Upload image and content using AJAX and Store it in different table

Created 9 months ago by SelvakumarHow-tos1 comment – viewed 23,375 times – ( +2 ) – version 1.1
We all know how to upload the content and images at the same time with refreshing the page. And uploading the images using Ajax we have faced some issues, here i have fixed the issues and both content and photos are uploaded using Ajax. And both content and images are stored in the different tables

Authenticating against phpass hashes with Yii

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

Keeping a running total in a CGridView

Created 3 years ago by Steve FriedlHow-tos4 comments – viewed 23,073 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 22,621 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.

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

Created 2 years ago by sirin kHow-tos6 comments – viewed 22,293 times – ( +8 / -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-tos5 comments – viewed 21,951 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.

Database driven Cmenu

Created 2 years ago by twisted1919How-tos0 comments – viewed 21,478 times – ( +13 / -1 ) – version 1.1
This is a simple example that will give you a base for designing a database driven menu system that will use CMenu to be rendered.

Converting an Artisteer Theme to Yii

Created 3 years ago by bgleeHow-tos3 comments – viewed 21,425 times – ( +9 ) – version 1.1
There are two approaches to converting an Artisteer theme. The first is to simply copy an existing Artisteer – based Yii theme, overlay the CSS and images, then make any necessary tweaks to the layout files. This is undoubtedly the fastest route, but won't teach you as much as doing it from scratch. That's ok. Sometimes getting the job done is the top priority. The second approach is more general and will apply to some extent to other HTML templates that you may want to convert. I'll be covering the first approach in detail, while the second will be more of a general discussion.

Using a CDbDataReader (sql query result) in a zii widget (such as CGridView or CListView)

Created 3 years ago by Revelis Luc BonninHow-tos1 comment – viewed 21,406 times – ( +9 / -1 ) – version 1.1
If in your application you have to proceed to a complex SQL query that is not associated to a model, you will use CDbDataReader like it is described in the Yii documentation. An example could be

How to insert a Simple Dialog Box

Created 3 years ago by bluyellHow-tos6 comments – viewed 21,291 times – ( +5 / -2 ) – version 1.1
I build this simple PHP class (DialogBox.php at the bottom of this wiki) to help you in the dialog box usage on Yii applications. The goal is run any Yii actions into this dialog box and return the resulting value to the calling instance.