Wiki articles in category Tips

Showing 1-20 of 32 items.

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 114 times
Version: 2.0
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 444 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: 7 887 times
Version: 2.0
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 374 times
Version: 2.0
Category: Tips

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

Created 5 years ago by Luis Lobo Borobia, updated a year 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 439 times
Version: all
Category: Tips

How to organize Design "things" in Yii 2 (themes and layout)

Created 8 months ago by s.oli, updated 7 months ago by samdark.

Sometimes the App needs a nicer look & feel, so its necessary to organize the assets for this and Yii can help a lot to make it easy. In this article I provide tips for handling multiple "Designs". I use these three features:

1 0
2 followers
Viewed: 8 891 times
Version: 2.0
Category: Tips

Locking your Yii 2 project package versions with composer.lock

Created 4 years ago by Kartik V, updated 4 years ago by Kartik V.

Ok, you have installed a Yii 2 basic or advanced app for the first time and completed the post install steps. You have picked up a few extensions to install for the first time as well. You would already see a composer.lock file in your application root folder.

0 2
37 followers
Viewed: 9 321 times
Version: 2.0
Category: Tips

Customize your Growl/Alert msg easy and quickly

Created 3 years ago by Scott_Huang, updated 3 years ago by Scott_Huang.

I leverage Kartik's notification widgets.

0 1
2 followers
Viewed: 9 720 times
Version: 2.0
Category: Tips

Load & Save With Relation

Created 3 years ago by moo.tensai, updated 3 years ago by moo.tensai.

Use this extension : yii2-relation-trait

1 0
2 followers
Viewed: 11 377 times
Version: 2.0
Category: Tips

Yii2: Query build for complexity SQL

Created 3 years ago by Scott_Huang, updated 3 years ago by Scott_Huang.

As for complexity SQL query we have two solutions as below, I will discuss #2 in this article.

0 0
3 followers
Viewed: 11 504 times
Version: 2.0
Category: Tips

Auto-update denormalized attributes with MongoDb and Yii2

Created 5 years ago by edoardo849, updated 5 years ago by CeBe.

You have different collections in MongoDb with de-normalized attributes. As you may know, due to its not-join nature, MongoDb tends to encourage repetition of the same value in different collections (de-normalization). In this MongoDb is opposed to a more SQL-like approach where you usually reference only the ID of the value with a foreign key.

1 0
3 followers
Viewed: 11 735 times
Version: 2.0
Category: Tips

YII2 Pagination Options

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

solution here If we are using default pagination option like

1 0
1 follower
Viewed: 12 034 times
Version: 2.0
Category: Tips

REST API and null values in XML

Created 2 years ago by marko60, updated 2 years ago by marko60.

I have been working on a REST API using the excellent tools provided by Yii2. My problem was that I have to differentiate between empty values and null values. In other words, <elem></elem> is different from null as it represents an empty string. Also, although some use <elem/> to represent a null value it should still be interpreted as an empty string. In other cases, the absence of the eleme...

0 0
0 follower
Viewed: 12 317 times
Version: 2.0
Category: Tips
Tags: null, REST, XML

Building a search GET request with scenarios ; calling a SearchModel from URLs...

Created 3 years ago by Louis Gac, updated 3 years ago by Louis Gac.

Search Models are a very elegant and powerful way to build an Active Data Provider. If you use them a lot, you'll quickly need to use scenarios, which will lead you to a very DRY Controller code.

0 0
2 followers
Viewed: 13 290 times
Version: 2.0
Category: Tips

My Own Components Folder in Yii2

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

In Yii1 I used to have my own components under the components folder of the structure, now with namespacing this is a little bit different.

2 1
2 followers
Viewed: 14 136 times
Version: 2.0
Category: Tips

Update and Delete buttons on Breadcrumb

Created 7 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: 15 740 times
Version: 2.0
Category: Tips

Configuring PhpStorm IDE for Yii 2

Created a year ago by CeBe, updated 11 months ago by CeBe.

There are a few settings and plugins that can enhance the development experience with Yii in PHPStorm or IntelliJ IDEA. This article explains how to get the most out of your IDE.

11 0
6 followers
Viewed: 18 091 times
Version: 2.0
Category: Tips

Boost composer-asset-plugin update speed

Created 2 years ago by schmunk, updated 2 years ago by samdark.

If you're using a lot of bower and npm assets with Yii 2.0 you might encounter long running composer update tasks.

6 0
6 followers
Viewed: 18 445 times
Version: 2.0
Category: Tips

Model validation for field ranges using yii2-field-range extension

Created 4 years ago by Kartik V, updated 4 years ago by Kartik V.

The yii2-field-range extension enables you to easily setup ActiveField range fields with Bootstrap styling. You basically can setup two attributes joined together like a single field with combined validation error block.

0 0
37 followers
Viewed: 18 881 times
Version: 2.0
Category: Tips

Key web server settings after installing a fresh Yii 2 basic or advanced app

Created 4 years ago by Kartik V, updated 4 years ago by Kartik V.

So, you have installed a brand new Yii 2 app (basic) or (advanced). Here are a few tips for Apache web server users to get things running more secure and better with your yii2 app.

2 0
46 followers
Viewed: 20 167 times
Version: 2.0
Category: Tips