Wiki

Articles in category "tips", sorted by date (updated)X
Displaying 81-90 of 99 result(s).

URL component access functions

Updated 2 years ago by Steve FriedlTips1 comment – viewed 7,773 times – ( +28 )
Many applications wish to obtain parts of the URL for the current page (the hostname, the query string, etc.), and the CHttpRequest class wraps various $_SERVER variables to break down the URL into its constituent parts.
tags: URL, request

Using jQuery UI 1.8.10 themes with Yii 1.1.6

Updated 2 years ago by samdarkTips7 comments – viewed 12,107 times – ( +2 )
When using the latest stable jQuery UI themes (1.8.10) with Yii 1.1.6 (which uses 1.8.6) the widgets don't appear (they're invisible but they're there). In order to make them visible you need to change the following line:

Functional tests independing from your urlManager settings

Updated 2 years ago by RusAlexTips1 comment – viewed 5,353 times
If you are testing your app and use urlManager in your config, sometimes you will find a problem: you want to test your site independing from urlManager settings. in that way you need to extend your WebTestCase class by this method:

Preventing CJuiTabs from hiding drop-down CMenu items

Updated 2 years ago by RusAlexTips0 comments – viewed 6,149 times – ( +4 )
Almost all Yii applications use CMenu at the top of each page to show options available to the user, and many include drop-down components to allow more fine-grained selection.

htmlOptions explained for various controls.

Updated 2 years ago by WoilTips1 comment – viewed 24,583 times – ( +16 )
Most controls that are rendered by CHtml have an argument called $htmlOptions. This argument is an array that holds the attributes of the HTML element. For example the following code:

Real Time Logging

Updated 2 years ago by lucifuriousTips1 comment – viewed 12,382 times – ( +12 )
I've seen a lot of people asking about the logging facilities in Yii and thought I'd share a nice little class I wrote that provides near real-time logging.

Yii code completion and calltips in Komodo Edit

Updated 2 years ago by weiTips1 comment – viewed 6,966 times – ( +5 )
My favourite editor is Komodo Edit (free and crossplatform) and I use it for my everyday coding work. Just recently I found out how to make it help me to work with Yii. :) So follow these steps:
tags: Komodo Edit

Putting Function To Be Called In View

Updated 2 years ago by junxiongTips2 comments – viewed 13,979 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

Auto TDD - How to auto-run PHPUnit

Updated 2 years ago by imeheszTips3 comments – viewed 9,144 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

Quick Tip about Pagination Params

Updated 2 years ago by Antonio RamirezTips2 comments – viewed 17,466 times – ( +5 )
Developing custom Grids and ListViews for my new CMS I was facing a small challenge: If I was to update/delete/batch delete items of my Grid, how would I return to the current page view?
tags: Pagination