Wiki

Articles in category "tips", sorted by ratingX
Displaying 61-70 of 97 result(s).

Auto TDD - How to auto-run PHPUnit

Created 2 years ago by imeheszTips3 comments – viewed 9,117 times – ( +3 )
If you are lucky enough and have the privilege to develop on a Linux based environment, this little tip might boost-up your TDD process (at least the Unit Testing part). Please note, that this should work just fine with Apple computers also, but not tested!
tags: PHPUnit, testing, TDD

A simple action for XUpload extension

Created 2 years ago by tydeas_drTips1 comment – viewed 9,708 times – ( +3 )
All the basic functionality for an action used by the xupload extension. Check resources for the source code of this action
tags: tips, xupload, caction

Patching PHP code (used as a library) without changing the original code!

Created 2 months ago by le_topTips0 comments – viewed 1,729 times – ( +3 )
The article Fixing extensions without modifying their code reminded me of another patching technique that I used. My conviction and a hard look on the web had led me to an article Redefine PHP class methods or class giving me a head start to do what I wanted: patching third party code without touching the original to allow easy upgrades.
tags: patch, patching

An important tip when you are using CArrayDataProvider.

Created 8 months ago by sirin kTips0 comments – viewed 3,653 times – ( +5 / -1 )
Yii ‘s CArrayDataProvider is very helpful to display model relation data's directly on it.But it is truely a confusing one because by default it will assume a table field named “id” as primary key for its pagination purpose and what if you dont have field named “id” as primary key on your table? so its truely confusing and if you tried to display without an “id” field on ur table you will get an error like “yourmodel.id is not defined”.

Saving files to a blob field in the database

Created 2 years ago by zaccariaTips7 comments – viewed 26,256 times – ( +6 / -2 )
As a follow-up from the How to upload a file using a model wiki entry that explains how to save a file to the filesystem, this article will do the same using a blob field in the database.
tags: File upload

Putting Function To Be Called In View

Created 2 years ago by junxiongTips2 comments – viewed 13,901 times – ( +4 / -1 )
Sometimes we need some complicated view to be displayed (such as generating complicated table). Most people suggest that in MVC the View must be as simple as possible (don't have too much loops, etc). So what we have to do is to hide away the complex code by putting it at somewhere else. The following are few places options to keep the function:
tags: view, render

Access log output from unit tests

Created 11 months ago by MikeTips2 comments – viewed 2,998 times – ( +2 )
Say, you want to write a test for a component which provides a caching feature. How would you know, that some method of your component returns a cached result? With the solution described here you can inspect all log outputs. So you could search the logs for accesses to the DB to really make sure, that the result was served from cache.

Solution for session lose of Facebook iframe application in Internet Explorer .

Created 8 months ago by sirin kTips0 comments – viewed 2,853 times – ( +2 )
Facebook iframe app’s session is losing in Internet Explorer when doing a second redirection inside the facebook iframe app.The main reason is ,by default IE wont allow cookies in its priavacy settings If cookies not available means session is also not available for our Facebook iframe app in IE.

Adding a link to a CDataColumn

Created 2 months ago by le_topTips3 comments – viewed 2,649 times – ( +2 )
Backoffice Grid Views often list information like Posts for a blog while showing at the same time linked information like the User who wrote that post. For more efficiency, it is appropriate that the User is displayed as a link to the User detail page.

CjuiDatepicker

Created 2 months ago by hiral darjiTips0 comments – viewed 2,484 times – ( +2 )
If you have two datepicker in one form and you want that a date of from date shold be minimum date of todate then put following code in Cjuidatepicker widget options array: