Wiki articles

Showing 121-140 of 822 items.

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

Created 9 years ago by Deepak Pradhan, updated 9 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: 9 086 times
Version: 2.0
Category: Tips

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

Created 9 years ago by le_top, updated 9 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: 9 946 times
Version: 1.1
Category: Tips

Yii2: Configuring different sessions for backend and frontend in Yii Advanced Application Template

Created 9 years ago by hrnair, updated 9 years ago by hrnair.

This is as an extension of this wiki by Kartik V which shows to make different enableAutoLogin cookies for frontend and backend.

3 0
7 followers
Viewed: 43 911 times
Version: 2.0
Category: How-tos

Easy way to redirect http:\\localhost\yii2-basic to http:\\localhost\yii2-basic\web\index.php

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

First of all, install yii2 basic template according below link:

1 0
5 followers
Viewed: 70 235 times
Version: 2.0
Category: Tips

Use CGridview to sort and filter CSqlDataProvider - when used with UNRELATED tables (or complex queries)

Created 9 years ago by Gerhard Liebenberg, updated 9 years ago by Gerhard Liebenberg.

I have two tables called hospitals and departments. I have a junction table between them which holds the departments in each hospital. But sometimes I need a list of "All hospitals with All possible departments" - regardless of whether they are linked in the junction table or not.

0 0
3 followers
Viewed: 24 718 times
Version: 1.1
Category: How-tos

Add model validator in Controller

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

There are cases that model validators should be depended by controller/action and you couldn't manipulate on the model class or using scenarios in easy way

1 1
3 followers
Viewed: 30 790 times
Version: 1.1
Category: Tips

Step by step for how to full export Yii2 grid to excel

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

We will leverage Yii2-excelview widget. So, first of all is install Yii2-excelview:

1 0
5 followers
Viewed: 74 427 times
Version: 2.0
Category: Tips

Simple Way to Upload and Save File

Created 9 years ago by Misbahul D Munir, updated 9 years ago by Misbahul D Munir.

This tutorial need extension mdmsoft/yii2-upload-file. Follow the intruction to install. After installation done, create controller and action

0 0
4 followers
Viewed: 38 722 times
Version: 2.0
Category: Tutorials
0 0
5 followers
Viewed: 46 036 times
Version: 2.0
Category: How-tos

Create Form With DynamicModel

Created 9 years ago by Misbahul D Munir, updated 9 years ago by Misbahul D Munir.

In yii2 we can create form without create FormModel. Here we go

4 0
8 followers
Viewed: 47 053 times
Version: 2.0
Category: Tips
Tags: form, model, yii2

Yii configuration: Dynamic & User dependent

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

It is difficult to perform user dependent theming through a general configuration in 'main.php'. This article proposes a method to do so through a Factory that dynamically generates classes to allow delayed resolution of actual user values. This means that you can refer to values that are stored in the database through the CActiveRecord before Yii is actually loaded. The values will be fetched...

1 0
1 follower
Viewed: 12 663 times
Version: 1.1
Category: How-tos

How to use imagine ( crop, thumb, effects for images ) on Yii2

Created 9 years ago by Anas AbuDayah, updated 8 years ago by Cozumel.

Imagine adds most common image functions and also acts as a wrapper to Imagine image manipulation library.

5 0
14 followers
Viewed: 98 515 times
Version: 2.0
Category: Tutorials

How to display images in CJuiAutoComplete without extenstions

Created 9 years ago by Asmaa, updated 5 years ago by samdark.

I wanted to customize the CJuiAutoComplete, so that it displays a thumb image before the label like the one shown in the following image:

0 0
2 followers
Viewed: 12 754 times
Version: 1.1
Category: Tutorials

How to hide /frontend/web in url addresses on apache

Created 9 years ago by raminious, updated 9 years ago by jim..

There is an issue on Yii2 to redirecting / urls to /frontend/web.
In other words we need a way to hidden /frontend/web from addresses.
We will do this without changing Apache configuration and creating virtual host or setting document root (It's good for share hostings that we have not access to apache.conf)

10 0
21 followers
Viewed: 125 354 times
Version: 2.0
Category: How-tos

MongoDB's RBAC support class extending BaseManager

Created 9 years ago by edoardo849, updated 9 years ago by edoardo849.

Here's a possible implementation for MongoDb of the RBAC standard. Create a class "MongoDbManager" in `common\components and modify your params.php` file like this:

0 0
4 followers
Viewed: 13 437 times
Version: 2.0
Category: How-tos
Tags: mongodb, rbac, yii2

Behaviour for Time Zone and Format conversion for Date, Time, timestamp, and datetime

Created 9 years ago by Smithesh, updated 8 years ago by Smithesh.

This Behaviour helps to view time/date/timestamp/datetime from db to local Date / Time / Date Time format and in local Timezone. And save into db in with db timezone and db format. You only need to include this behaviour in models where need this facility.

2 0
3 followers
Viewed: 21 596 times
Version: 1.1
Category: How-tos

embedded javascript block in your view with IDE checking or intellisense

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

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

2 0
3 followers
Viewed: 13 024 times
Version: 2.0
Category: Tips

Check users online, user last activity, user last ip

Created 9 years ago by frazelli, updated 9 years ago by frazelli.

Stores session data in database and transfer data when session is destroy. Uses for check users online, user's last activity and last ip.

3 0
7 followers
Viewed: 21 900 times
Version: 1.1
Category: How-tos

How to implement form events

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

You have that, when a product is on development they can change its API anytime. This change is quite important though, its related on how to set the events of your form, for example, the useful beforeSubmit.

5 0
6 followers
Viewed: 37 832 times
Version: 2.0
Category: How-tos
Tags: Forms, How to, yii2

Building a REST API in Yii2.0

Created 9 years ago by sirin k, updated 6 years ago by Maurizio Domba Cerin.

This is wiki page is useful if you are trying to build a customized REST API in Yii2.0

4 0
16 followers
Viewed: 148 908 times
Version: 2.0
Category: Tutorials