Wiki

Articles in category "how-tos", sorted by ratingX
Displaying 61-70 of 355 result(s).

Using standard filters in CGridView custom fields

Created 6 years ago by GOshaHow-tos4 comments – viewed 64,025 times – ( +17 / -1 ) – version 1.1
In this article I'll try to explain how to use standard quick search fields in CGridView with customized columns.For example: We have a record in a database with field switch having 0 or 1 values. After that we want a user to see on or off instead 1 or 0. So we do the usual thing:

Moving project code outside of webroot (plus multiple project support)

Created 6 years ago by Steve FriedlHow-tos8 comments – viewed 51,182 times – ( +22 / -2 ) – version 1.1
Yii's by-default directory organization works well enough, but there are several steps one can take that improve the security and serviceability of the system, especially in the context of multiple Yii projects on the same machine (including multiple versions of the same project).
tags: config, security

Creating a CSS Driven Drop Down Menu using CMenu

Created 6 years ago by blindMoeHow-tos10 comments – viewed 88,657 times – ( +22 / -2 ) – version 1.1
CMenu offers great functionality and the ability to customize just about every aspect of the output. There are many times when I need to create a drop down menu or simply modify the look to make the designers happy. Because this seems to be a common task for me, I figured I would share my code to create a very simple drop down menu that other people could use.

Displaying uploaded file from DB for update with FileInput widget

Created 3 years ago by Kartik VHow-tos3 comments – viewed 37,265 times – ( +39 / -6 ) – version 2.0
This is for folks who are using \kartik\widgets\FileInput to upload files from your client. How do you display an image for update after you have uploaded it to the server using the widget?

Managing a star rating with the StarRating widget in Yii 2

Created 3 years ago by Kartik VHow-tos4 comments – viewed 12,631 times – ( +38 / -6 ) – version 2.0
In Yii 1.x, there was a built in widget CStarRating based on the jquery star rating plugin. There exists no prebuilt solution in Yii2, however the same concepts can be extended using any jquery plugin.

Kickstart development with Yii-App

Created 4 years ago by Chris83How-tos25 comments – viewed 32,489 times – ( +21 / -2 ) – version 1.1
I recently created a project called Yii-App on GitHub to kickstart my development of smaller Yii applications. The main goal of the project is to provide a ready-to-use application template that includes my bootstrap extension and many other useful extensions. After reading this article you will be able to use this project as a starting point for all of your Yii projects.

Simple authorization system

Created 5 years ago by GustavoHow-tos1 comment – viewed 35,073 times – ( +16 / -1 ) – version 1.1
How to create a simple (non-RBAC) authorization system

How to avoid multiple Ajax Request

Created 6 years ago by nickcvHow-tos26 comments – viewed 55,655 times – ( +25 / -3 ) – version 1.1
CHtml::ajaxLink(), CHtml::ajaxSubmitButton() and similar methods are great, but if they are located inside a portion of the page that is already loaded via ajax something bad will happen, something you may even not notice if you are not using tools like firebugs: the sent ajax requests will multiply themselves.

Integrating HybridAuth directly into Yii without an extension

Created 4 years ago by biz devHow-tos8 comments – viewed 40,903 times – ( +15 / -1 ) – version 1.1
This article tries to explain the steps required in integrating the HybridAuth into Yii directly, without using an extension.

Drop down list with enum values for column of type ENUM >+> incorporate into giix

Created 5 years ago by c@cbaHow-tos4 comments – viewed 37,221 times – ( +14 / -1 ) – version 1.1
Let's say our table 'mug' has a column named 'color' of the type ENUM('red','green','blue'). We want to replace the textfield for the attribute color in the create and update forms of a 'mug' with a drop down list, which has the enum values as options. The main code was contributed by zaccaria in the forum (see this post).