Wiki

Articles in category "tips"X
Displaying 71-80 of 97 result(s).

Yii实战中8个必备常用的扩展,模块和

Created 2 years ago by Darwin WenTips2 comments – viewed 11,459 times – ( +2 / -3 )
在经过畅K网的实战后,总结一下在Yii的项目中会经常用到的组件和一些基本的使用方法,分享给大家,同时也给自己留个备忘录,下面我以代码加图片说明.
tags: module, Widgets

An easy way to use escopes and CActiveDataProvider

Created 2 years ago by Rafael GarciaTips8 comments – viewed 13,843 times – ( +1 / -1 )
Often used scopes to define criteria in our models. This is a very useful feature as it ensures that in any part of application applying the criteria defined by the scope when called it.

An easy way to display a success page using flash messages

Created 2 years ago by qiangTips2 comments – viewed 13,711 times – ( +23 )
We often need to display a success page after the user has submitted a form without problem. We may show some welcome message after a user registers a new account. There are many ways to implement this workflow. In this article, I will explain a method that exploits flash messages.

A simple action for CJuiAutoComplete

Created 2 years ago by tydeas_drTips7 comments – viewed 17,667 times – ( +14 / -1 )
More or less I use auto-complete field for a form. CJuiAutoComplete is a yii widget for this purposes. The common use case is to make an ajax request and retrieve a list from the database. So in this case you have to write a controller action to return you a json encoded list. What if I had a generic action to do this work for me?

URL component access functions

Created 2 years ago by Steve FriedlTips1 comment – viewed 7,747 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

Created 2 years ago by a110yTips7 comments – viewed 12,083 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

Created 2 years ago by RusAlexTips1 comment – viewed 5,333 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:

htmlOptions explained for various controls.

Created 2 years ago by WoilTips1 comment – viewed 24,364 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:

Search method of a model for filters when using dates - unixtimestamp in database

Created 2 years ago by MukkeTips1 comment – viewed 14,986 times – ( +10 )
I ran into a problem and on irc we worked it out. Since there is a lack on information on filters in genral i thought i'd start sharing all my findings, might be usefull for other people.

Real Time Logging

Created 2 years ago by lucifuriousTips1 comment – viewed 12,290 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.