Wiki articles

Showing 121-140 of 803 items.

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: 22 851 times
Version: 1.1
Category: Tips

Simple access control

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

For those who feel, the Controller->accessRules() or RBAC (Role-Based Access Control) is too complicated or doesn't want the username(s) to be hard-coded in accessRules(), here is a very simple, easy-to-implement solution.

3 7
10 followers
Viewed: 42 080 times
Version: 1.1
Category: Tutorials

Install specific Yii2 vendor extension & dependency without updating other packages.

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

The tips here are for advanced usages of composer and its assumed you have read about using composer and have a knowledge of your vendor packages to be updated. Let's consider, you want to update only one specific yii2 vendor library, without updating all the other extension packages?

2 3
39 followers
Viewed: 29 486 times
Version: 2.0
Category: Tips

Managing your nested dropdown dependency with DepDrop widget

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

If you are coming over to Yii 2 from Yii 1.x, you may have already read this useful wiki for creating dependent dropdowns. You can use a similar approach in Yii 2 to do the same. But if you are looking at a prebuilt solution that helps you manage it easier, read along.

2 3
43 followers
Viewed: 36 389 times
Version: 2.0
Category: Tutorials

Yii实战中8个必备常用的扩展,模块和

Created 8 years ago by Darwin Wen, updated 8 years ago by Darwin Wen.

在经过畅K网的实战后,总结一下在Yii的项目中会经常用到的组件和一些基本的使用方法,分享给大家,同时也给自己留个备忘录,下面我以代码加图片说明.

2 3
9 followers
Viewed: 35 650 times
Version: 1.1
Category: Tips

Extending an ActiveRecord model

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

protected $_viewFile

2 3
7 followers
Viewed: 22 981 times
Version: 1.1
Category: How-tos

AutoTimestampBehavior

Created 10 years ago by jonah, updated 7 years ago by Yang He.

This behavior will automatically set timestamp fields to the row creation and modification times.

2 2
3 followers
Viewed: 16 984 times
Version: 1.1
Category: Tutorials
Tags:

"safe" and "unsafe" Model validators (massive assignments)

Created 6 years ago by Kostas Apazidis (KonApaz), updated 3 years ago by brianvu.

Ok, it is a little bit difficult to full understanding the unsafe validator.

2 2
7 followers
Viewed: 28 278 times
Version: 1.1
Category: How-tos

Create/Develop View files with plain HTML (Without using ActiveForm Class)

Created 6 years ago by kalpit, updated 5 years ago by CeBe.

Today i want to share with you is "How can we write HTML Code in view files? I am writing this article because many times we can not use CActiveForm to design our form...

2 2
6 followers
Viewed: 16 713 times
Version: 1.1
Category: How-tos

Activating Bootstrap 3 Tooltips & Popover for your Yii Site.

Created 5 years ago by Kartik V, updated a year ago by alrazi.

Step 1: Initialize the Bootstrap Tooltip & Popover plugins in your view layout file @web\views\layouts\main.php. Add this to somewhere in the beginning head section (after you have loaded the Jquery using your AppAsset or something similar).

2 2
47 followers
Viewed: 53 184 times
Version: 2.0
Category: Tips

Handling tabular data loading and validation in Yii 2

Created 5 years ago by Kartik V, updated 3 years ago by Said Bakr.

The only differences in Yii 2 is that its much simpler due to available functions in the Model class for loading and validating models.

2 2
51 followers
Viewed: 48 648 times
Version: 2.0
Category: Tutorials

Two Login in same form in Yii application , with two tables

Created 6 years ago by Balu, updated 5 years ago by Rohit Suthar.

login links will be

3 4
6 followers
Viewed: 26 121 times
Version: 1.1
Category: Tutorials

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: 6 268 times
Version: 1.1
Category: Tips

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: 6 899 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: 7 571 times
Version: 1.1
Category: How-tos

How to pass the third parameter to UserIdentity on login authentication

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

In this wiki I will show how could wo pass the third parameter to UserIdentity on login authenticate. So we can do separate login authentcation from two or more different models from single login form.

1 0
5 followers
Viewed: 24 556 times
Version: 1.1
Category: How-tos

How to use Highslide for image popups

Created 10 years ago by mocapapa, updated 9 years ago by wei.

>Highslide JS is an open source JavaScript software, offering a Web 2.0 approach to popup windows. It streamlines the use of thumbnail images and HTML popups on web pages. > > + No plugins like Flash or Java required. > + Popup blockers are no problem. The content expands within the active browser window. > + Single click. After opening the image or HTML popup, the user can scroll further down...

1 0
2 followers
Viewed: 23 222 times
Version: 1.1
Category: Tutorials
Tags: image, popups

Customizing the CMenu Widget

Created 6 years ago by mistryb, updated 5 years ago by mistryb.

The CMenu class provides some useful features for generating menus in your web application.

1 0
4 followers
Viewed: 60 605 times
Version: 1.1
Category: Tips

checkBox in CGridview

Created 4 years ago by n-r, updated 4 years ago by n-r.

some when you need to add checkbox in cgridview and change state of selected rows by additianal parameters. in view :

1 0
2 followers
Viewed: 25 019 times
Version: 1.1
Category: Others

How to validate the uniqueness of multiple columns

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

I am going to show you an effective way to validate the uniqueness of multiple columns.

1 0
2 followers
Viewed: 11 293 times
Version: 1.1
Category: How-tos