Articles in category "how-tos", sorted by commentsX
Displaying 91-100 of 355 result(s).

Run Yiic directly from your app without a shell

Created 5 years ago by jacmoeHow-tos6 comments – viewed 34,987 times – ( +18 / -1 ) – 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.

Use CGridview to sort and filter CSqlDataProvider - when used with UNRELATED tables (or complex queries)

Created 2 years ago by Gerhard LiebenbergHow-tos6 comments – viewed 17,703 times – ( -1 ) – version 1.1
I have two tables called hospitals and departments. I have a junction table between them which holds the departments in each hospital. But sometimes I need a list of "All hospitals with All possible departments" - regardless of whether they are linked in the junction table or not.

AssetManager: clearing browser's cache on site update

Created 5 years ago by dhampikHow-tos5 comments – viewed 39,035 times – ( +19 / -1 ) – version 1.1
If you like the things to be short and clear, then you can skip right to a short summary of instructions at the end of this article.

CGridView keep state of page and sort.

Created 5 years ago by DanielHow-tos5 comments – viewed 28,041 times – ( +6 / -1 ) – version 1.1
Remember-filters-gridview is one of the must-use extension on all of my project. However, it lacks of storing the page and sort variables of the grid view.

Displaying image in a CGridView column.

Created 5 years ago by sirin kHow-tos5 comments – viewed 62,532 times – ( +13 / -2 ) – version 1.1
This is a simple example of how we can display images in CGridviews.Imagine that you have an image field in your table ie either a location field or a blob type field used to store the images.
tags: CGridView, image

CSV Export

Created 5 years ago by JohnPollardHow-tos5 comments – viewed 17,651 times – ( +4 / -1 ) – version 1.1
I needed a csv export function for my cgridview and I wanted to export the entire result set of the sorted and filtered cgridview the user was viewing via ajax.
tags: csv, export

Using SQLite and CDbMessageSource as a module

Created 5 years ago by pheadeauxHow-tos5 comments – viewed 15,021 times – ( +5 / -1 ) – version 1.1
There are scenarios when you work with DVCS (like Mercurial or Git) and CDbMessageSource. To my experience keeping the development database and production database in sync can be very time consuming. Plus, when working in a team, you never know when the database was updated.

Take more control of CGridview and model searching (related model or another controller)

Created 3 years ago by Kostas Apazidis (KonApaz)How-tos5 comments – viewed 31,315 times – ( +5 / -1 ) – version 1.1
Suppose you have an Application in Yii that manages hotels each one has many customers.

Dynamic Sidebar using CClipWidget

Created 6 years ago by SheldmanduHow-tos5 comments – viewed 27,741 times – ( +21 / -1 ) – 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.

X-Sendfile - serve large static files efficiently from web applications

Created 6 years ago by Maurizio Domba CerinHow-tos5 comments – viewed 63,938 times – ( +26 / -1 ) – version 1.1
Normally when we want users to download a file, that file is put in a folder under the web application root and the web server does the rest.