Wiki articles in category Tips

Showing 1-20 of 158 items.

Things to Consider when application hosting on AppFog

Created 4 years ago by VINAY Kr. SHARMA, updated 4 years ago by VINAY Kr. SHARMA.

I faced many issues when hosted our company website on AppFog.

1 0
1 follower
Viewed: 5 167 times
Version: 1.1
Category: Tips

Analyse the server's USER-AGENT against browsecap file to determine it's capability.

Created 4 years ago by Deepak Pradhan, updated 4 years ago by Deepak Pradhan.

Does your application need to know user's details on browser details, os and device type? We can use PHP's misc. function to achieve that provided you have an update copy of browsercap.ini

0 0
0 follower
Viewed: 5 239 times
Version: 2.0
Category: Tips

What SQL-Statement creates yii?

Created 10 months ago by Necip, updated 10 months ago by Necip.

The usual way to find out what Yii has created for an SQL query is to mutilate the SQL in the sourcecode and call the program again so that the SQL statement with errors is displayed. Or you can use the SQL logger, which must be switched on and off each time and logs all SQL statements, which leads to an enormous slowdown in program execution and decelerates your workflow.

0 0
1 follower
Viewed: 5 651 times
Version: 1.1
Category: Tips

Provide SVG when the browser supports it, else PNG (using CHtml::image overload)

Created 4 years ago by le_top, updated 4 years ago by le_top.

Modern browsers support SVG, older browsers do not. This replacement for CHtml::image() allows you to handle to propose SVG in an efficient way with PNG as a fallback.

1 0
1 follower
Viewed: 5 918 times
Version: 1.1
Category: Tips

More on SSE and Yii

Created 6 years ago by Firebreaker, updated 6 years ago by Firebreaker.

This is not actually Yii involved.

1 0
1 follower
Viewed: 7 084 times
Version: Unknown (update)
Category: Tips

Create URL to language switcher anchor with langhandler

Created 5 years ago by Anas AbuDayah, updated 5 years ago by Anas AbuDayah.

This topic is related with langhandler extension

1 1
2 followers
Viewed: 7 250 times
Version: 1.1
Category: Tips

Custom Archive in Blog system

Created 6 years ago by nirmalroka, updated 6 years ago by nirmalroka.

Hi I had made simple archive system for blog system that can handle tbl_post. I had used simple CDbCriteria not more than that. I know there is more and many better way to this but I think this will give some idea to users to generate new idea or customized or modified this version of code.

1 0
2 followers
Viewed: 7 443 times
Version: 1.1
Category: Tips

Useful Multilanguage extensions collection and use.

Created 5 years ago by cihappy, updated 4 years ago by Rohit Suthar.

What I want to achieve:

2 0
3 followers
Viewed: 7 562 times
Version: 1.1
Category: Tips

Search scenario (CGridView, etc.): avoid default values from database as search condition.

Created 4 years ago by le_top, updated 4 years ago by le_top.

Yii has a neat "trick" that will assign default values to new CActiveRecords. When performing a search() though, this is pretty annoying as they automatically apply as filter values.

1 0
2 followers
Viewed: 7 690 times
Version: 1.1
Category: Tips

A universal model attribute for its synthetic representation

Created 2 years ago by Alexandre Rodichevski, updated 2 years ago by Alexandre Rodichevski.

It is convenient to use the same identification attribute, say info, in all of the active records of your application. It should be a virtual read-only attribute defined by a getter method, its label being the model name.

0 0
3 followers
Viewed: 7 926 times
Version: 2.0
Category: Tips

embedded javascript block in your view with IDE checking or intellisense

Created 4 years ago by yiqing95, updated 4 years ago by yiqing95.

this is my way for embed js code block in view file:

1 0
3 followers
Viewed: 8 081 times
Version: 2.0
Category: Tips

Cgridview counter column

Created 5 years ago by Nisanth thulasi, updated 5 years ago by trond.

some times we want to show the serialNo on cgridview .

4 0
8 followers
Viewed: 8 101 times
Version: Unknown (update)
Category: Tips

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

Created 6 years ago by le_top, updated 6 years ago by le_top.

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](http://stackoverflow.com/questions/137006/ph...

4 0
5 followers
Viewed: 8 533 times
Version: 1.1
Category: Tips

Using PayPal IPN with Yii2

Created 4 years ago by darioo, updated 4 years ago by darioo.

I'm using PayPal's script from

0 0
1 follower
Viewed: 8 541 times
Version: 2.0
Category: Tips

Using Nginx and Apache2 in separate distributed servers (ie, Amazon EC2 instances)

Created 6 years ago by Luis Lobo Borobia, updated 2 years ago by Luis Lobo Borobia.

We are running one frontend running NGINX and several app servers running Apache2. There are several issues we have come across but right now I'll be documenting one of them. I'll be completing this article when I get more time.

2 0
2 followers
Viewed: 8 618 times
Version: all
Category: Tips

Inline views, write less

Created 6 years ago by Firebreaker, updated 6 years ago by Firebreaker.

Sometimes writing views like

3 0
3 followers
Viewed: 8 657 times
Version: Unknown (update)
Category: Tips

Set a menu - reusable code

Created 5 years ago by Kostas Apazidis (KonApaz), updated 5 years ago by Kostas Apazidis (KonApaz).

As we know Using crud generator creates menu items in view files (for each view file have a varius menu items)

1 0
3 followers
Viewed: 8 686 times
Version: Unknown (update)
Category: Tips

How to preload dropdowns in CForm

Created 5 years ago by transistor, updated 5 years ago by transistor.

So you want to use CForm (form builder), but need to preload dropdowns in a form? It's simpler than it seems.
You got your CFormModel, CForm and the actual Form, right?
Let's say you have the typical State -> City dependent dropdowns, so you would want to load the from with the State and City selected.

1 0
2 followers
Viewed: 8 795 times
Version: Unknown (update)
Category: Tips

Search a file size range in CGridView

Created 6 years ago by CrazyCat, updated 6 years ago by CrazyCat.
  1. Create an Active Record Behavior that builds the criteria for the search() method and attach it to your model
  2. Modify the search() method of the model to merge the behavior's criteria in with the rest of the searchable attributes
2 0
2 followers
Viewed: 8 887 times
Version: Unknown (update)
Category: Tips

an easy way to required multi columns(At least one cannot be blank)

Created 7 years ago by 1065227709, updated 7 years ago by 1065227709.

in model add the following code:

3 0
3 followers
Viewed: 9 062 times
Version: 1.1
Category: Tips
Tags: rules