Wiki articles in category Tips

Showing 1-20 of 158 items.

Update and Delete buttons on Breadcrumb

Created 9 months ago by Daniel.

The definition of breadcrumbs according to its documentation is as follow: Breadcrumbs displays a list of links indicating the position of the current page in the whole site hierarchy.

0 0
1 follower
Viewed: 21 370 times
Version: 2.0
Category: Tips

Ajax update

Created 8 years ago by zaccaria, updated 8 years ago by zaccaria.

Often happens to have the need of change a part of the page with ajax.

16 2
14 followers
Viewed: 52 145 times
Version: 1.1
Category: Tips
Tags: AJAX

Reading the doc

Created 8 years ago by zaccaria, updated 8 years ago by Orteko.

Almost all the information you need whilst working with yii is written in the Class Reference.

21 0
3 followers
Viewed: 9 268 times
Version: 1.1
Category: Tips
Tags: doc

Saving files to a blob field in the database

Created 8 years ago by zaccaria, updated 8 years ago by zaccaria.

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.

5 2
17 followers
Viewed: 65 340 times
Version: 1.1
Category: Tips

Code style

Created 8 years ago by zaccaria, updated 8 years ago by g3ck0.

Often, when writing widgets or editing Yii code, it is unclear whether or not the code is following the MVC pattern.

29 0
7 followers
Viewed: 21 287 times
Version: 1.1
Category: Tips
Tags: mvc

Directory independent extensions

Created 8 years ago by GOsha, updated 8 years ago by GOsha.

Many people want to use downloaded extensions in their own way. As for me most of the extensions require me to correct Yii::import() instructions inside their source code. All these extensions are directory dependent. To avoid the situation described above, I suggest to implement pseudo-anonymous aliases:

// take the curr...
16 1
7 followers
Viewed: 13 553 times
Version: 1.1
Category: Tips

Styling Radio Buttons

Created 8 years ago by Steve Friedl, updated 8 years ago by Steve Friedl.

The default behavior with radio button lists is ugly, and I figured out mostly how to style them a coupla different ways. I'll used the blog tutorial example (but with my own posting modes):

10 0
9 followers
Viewed: 58 662 times
Version: 1.1
Category: Tips

Extending CActiveForm for some form display fixes and language tweaks

Created 8 years ago by Trejder, updated 8 years ago by Trejder.

In this simple example I'll demonstrate how to extend CActiveForm class to overload some drawing functions to achieve some commonly used fixes in forms.

The colon

Here is overloaded version of CActiveForm.labelEx that adds colon (:) at the end of text of label with respecting CHtml::$afterRequiredLabel and CHtml::$beforeRequiredLabel

5 0
6 followers
Viewed: 19 257 times
Version: 1.1
Category: Tips

ChromePHP for Yii

Created 8 years ago by imehesz, updated 8 years ago by imehesz.

ChromePHP is a console logging extension for Google Chrome.

3 1
4 followers
Viewed: 14 807 times
Version: 1.1
Category: Tips

Quick Tip about Pagination Params

Created 8 years ago by Antonio Ramirez, updated 8 years ago by Antonio Ramirez.

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?

5 0
8 followers
Viewed: 33 089 times
Version: 1.1
Category: Tips

Auto TDD - How to auto-run PHPUnit

Created 8 years ago by imehesz, updated 8 years ago by imehesz.

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!

3 0
6 followers
Viewed: 17 965 times
Version: 1.1
Category: Tips

Putting Function To Be Called In View

Created 8 years ago by junxiong, updated 8 years ago by junxiong.

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:

5 1
5 followers
Viewed: 42 621 times
Version: 1.1
Category: Tips
Tags: render, view

Yii code completion and calltips in Komodo Edit

Created 8 years ago by viter, updated 8 years ago by wei.

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:

5 0
3 followers
Viewed: 12 867 times
Version: 1.1
Category: Tips

Real Time Logging

Created 8 years ago by lucifurious, updated 8 years ago by lucifurious.

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.

13 0
17 followers
Viewed: 29 621 times
Version: 1.1
Category: Tips

htmlOptions explained for various controls.

Created 8 years ago by Woil, updated 8 years ago by Woil.

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:

15 0
14 followers
Viewed: 60 452 times
Version: 1.1
Category: Tips

Preventing CJuiTabs from hiding drop-down CMenu items

Created 8 years ago by Steve Friedl, updated 8 years ago by RusAlex.

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.

4 0
3 followers
Viewed: 12 290 times
Version: 1.1
Category: Tips

Functional tests independing from your urlManager settings

Created 8 years ago by RusAlex, updated 8 years ago by RusAlex.

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:

0 0
4 followers
Viewed: 10 640 times
Version: 1.1
Category: Tips

Using jQuery UI 1.8.10 themes with Yii 1.1.6

Created 8 years ago by a110y, updated 8 years ago by samdark.

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:

2 0
2 followers
Viewed: 19 815 times
Version: 1.1
Category: Tips

URL component access functions

Created 8 years ago by Steve Friedl, updated 8 years ago by Steve Friedl.

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.

28 0
16 followers
Viewed: 15 511 times
Version: 1.1
Category: Tips
Tags: request, URL

Extending common classes to allow better customization

Created 8 years ago by Steve Friedl, updated 8 years ago by Steve Friedl.

The two most commonly-used base classes in most Yii applications are CController and CActiveRecord, each extended to your own particular models and controllers.

36 0
19 followers
Viewed: 33 719 times
Version: 1.1
Category: Tips
Tags: