Wiki

Sorted by commentsX
Displaying 781-786 of 786 result(s).

Inline views, write less

Created 4 years ago by FirebreakerTips0 comments – viewed 6,934 times – ( +3 / -1 )
Sometimes writing views like

Yii configuration: Dynamic & User dependent

Created 3 years ago by le_topHow-tos0 comments – viewed 6,410 times – ( +1 / -1 ) – version 1.1
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 from the database when actually used for the first time, which is after Yii is loaded. Actually, you can use pretty much any method that relies on Yii with this method.

Simple Way to Upload and Save File

Created 3 years ago by Misbahul D MunirTutorials0 comments – viewed 20,604 times – ( -3 ) – version 2.0
This tutorial need extension mdmsoft/yii2-upload-file. Follow the intruction to install. After installation done, create controller and action

Checking for "expired" sessions/logins on the client side

Created 4 years ago by le_topHow-tos0 comments – viewed 24,696 times – ( +6 / -1 ) – version 1.1
Getting "Expired token" errors ? Here is a solution to avoid invalid CSRF on POST or ajax requests, or user identity changes.

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

Created 3 years ago by Scott_HuangTips0 comments – viewed 17,768 times – ( +3 / -4 ) – version 2.0
First of all, install yii2 basic template according below link:

Using events with CAction classes

Created 6 years ago by Antonio RamirezTips0 comments – viewed 15,875 times – ( +10 / -1 ) – version 1.1
There are some good guides out there explaining how to work with events and the ways to attach them to your components, but none (that I know) explain the following way to configure your events with CAction classes on your controllers the following way.