Wiki articles

Showing 101-120 of 810 items.

Clear CGridView Filters, Sort & Pager

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

Clearing CGridView filters and sort orders from the web pages, is usefull for the end user. Yii does not seem to propose a standard method. Furthermore, this is especially usefull when filters are "remembered" in the user's session.

2 0
3 followers
Viewed: 14 856 times
Version: 1.1
Category: How-tos

How to keep filters simple in CGridView

Created 5 years ago by Peppe, updated 5 years ago by le_top.

The problem is not new: after setting some filters in a grid (typically in admin view), and gone to another page, returning in the grid's page I would like to find the filters with previous setting mantained.

0 0
2 followers
Viewed: 10 373 times
Version: 1.1
Category: How-tos

Themed translations (i18n)

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

When using themes you want to changes some of the translations specifically to the theme while keeping the standard translations for most of the text. Duplicating the main translation file is a headache for maintainance. This how to provides a solution.

1 0
1 follower
Viewed: 8 286 times
Version: 1.1
Category: How-tos

How to nest DB transactions without actually nesting them.

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

To secure your database from inconsistencies resulting from failing (complex) operations, you (should) use transactions. However, complex methods often rely on other complex methods that themselves build on transactions. This HowTo presents a method to nest or embed transactions without relying on the database's nesting capabilities.

1 0
1 follower
Viewed: 7 564 times
Version: 1.1
Category: How-tos

Gettext and Poedit HOWTO

Created 5 years ago by Maug Lee, updated 5 years ago by Maug Lee.

Example settings when using Gettext for i18n.

0 0
2 followers
Viewed: 10 180 times
Version: 1.1
Category: Tutorials

Pjax on ActiveForm and GridView - Yii2

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

Here is a example on how to use Pjax with GridView (yii\grid\GridView) and ActiveForm (yii\widgets\ActiveForm) widgets in Yii2.

6 0
15 followers
Viewed: 137 278 times
Version: 2.0
Category: How-tos

RBAC Super Simple with Admin and User

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

One of the common requests I see in the forum is how to implement RBAC. While you can implement Yii 2's built-in RBAC, that might be too much for developers who are just starting with Yii 2 or have simpler needs. Sometimes you are looking for a fast solution and just want two flavors, user and admin. And even if you will eventually need more, you can use these methods as a starting point for devel...

6 1
14 followers
Viewed: 86 179 times
Version: 2.0
Category: Tutorials

Yii Rights Management Tips

Created 5 years ago by Rajith R, updated 5 years ago by Rajith R.

yii rights some tips..

2 0
4 followers
Viewed: 10 183 times
Version: 1.1
Category: Tips

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

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

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

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

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

Created 5 years ago by hrnair, updated 5 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: 37 024 times
Version: 2.0
Category: How-tos

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

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

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

1 0
5 followers
Viewed: 41 094 times
Version: 2.0
Category: Tips

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

Created 5 years ago by Gerhard Liebenberg, updated 5 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: 22 589 times
Version: 1.1
Category: How-tos

Add model validator in Controller

Created 5 years ago by Kostas Apazidis (KonApaz), updated 5 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: 24 329 times
Version: 1.1
Category: Tips

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

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

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

0 0
5 followers
Viewed: 61 329 times
Version: 2.0
Category: Tips

Simple Way to Upload and Save File

Created 5 years ago by Misbahul D Munir, updated 5 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: 30 821 times
Version: 2.0
Category: Tutorials
0 0
5 followers
Viewed: 38 879 times
Version: 2.0
Category: How-tos

Create Form With DynamicModel

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

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

3 0
8 followers
Viewed: 36 777 times
Version: 2.0
Category: Tips
Tags: form, model, yii2

Yii configuration: Dynamic & User dependent

Created 5 years ago by le_top, updated 5 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: 9 399 times
Version: 1.1
Category: How-tos

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

Created 5 years ago by Anas AbuDayah, updated 4 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: 83 264 times
Version: 2.0
Category: Tutorials