Wiki

Articles in category "how-tos", sorted by commentsX
Displaying 21-30 of 325 result(s).

Searching and Sorting by Count of Related Items in CGridView

Created 2 years ago by softarkHow-tos14 comments – viewed 32,250 times – ( +30 ) – version 1.1
Let's say we have two models and relation between them:

How to use a Widget as an Action Provider

Created 3 years ago by Antonio RamirezHow-tos14 comments – viewed 33,171 times – ( +27 ) – version 1.1
As written on the API docs: An Action Provider Widget is a widget that has declared several actions by using its 'public static function actions()'. After, a Controller can easily import all its declared actions on its 'public function actions()'.
tags: Widgets, CAction

Using CJuiDatePicker for CGridView filter

Created 2 years ago by softarkHow-tos13 comments – viewed 35,837 times – ( +24 ) – version 1.1
We can use a CJuiDatePicker for a CGridView inline filter.

How to use PHPExcel external library with Yii

Created 4 years ago by Antonio RamirezHow-tos13 comments – viewed 65,444 times – ( +29 / -1 ) – version 1.1
Trying to learn and help some other programmers to find their solutions on the Yii Forum (I think is a superb way to learn the framework), I was facing one challenge with an external library that a fellow programmer wanted to use -quite good indeed: PHPExcel. And what is PHPExcel?

Actions code reuse with CAction

Created 3 years ago by Antonio RamirezHow-tos13 comments – viewed 31,831 times – ( +36 ) – version 1.1
We all know how good 'gii' automates the code for us and we normally tend to be happy with what that tool offers at the beginning of our Yii learning curve. But as soon as you start working in larger and larger projects, you realize that its code is too repetitive to maintain and having a small pitfall in general actions means to go over and over through them to fix the issues.
tags: CAction, Tutorial

Create your own Validation Rule

Created 3 years ago by nickcvHow-tos12 comments – viewed 135,333 times – ( +75 / -3 ) – version 1.1
Some times the core validation rules provided by Yii won't satisfy all your needs, so you'll need to create your very own validation rule.

CKEditor Integration (includes steps for file uploads) - Step by Step

Created 2 years ago by shulmeHow-tos12 comments – viewed 36,437 times – ( +25 ) – version 1.1
Hey guys, I'm hoping other people will find this helpful. Today I went through the process of adding CKEditor to one of my projects, and then integrating KCFinder as the image uploader. It will be used in a CActiveForm, without the use of any crazy weird widgets. All paths are relative, using Yii functions, so this will work no matter where you install. Here it is:

How to show ajax delete status in CGridView like flash messages

Created 3 years ago by hasanaviHow-tos12 comments – viewed 35,915 times – ( +22 ) – version 1.1
I've seen many tickets regarding how to show friendly delete confirmation using CGridView's CButtonColumn in ajax request. If you are using relational database, after producing CRUD functionality when you try to delete a record in ajax mode which has child record it can't be deleted and you can see the ajax loader forever. By this way you can't show the users if a record has been successfully deleted or if there are some problem in flash style (setFlash() / getFlash())

URL management for Websites with secure and nonsecure pages

Created 2 years ago by qiangHow-tos11 comments – viewed 22,488 times – ( +27 ) – version 1.1
In this article, I will describe how to manage URLs for a Website that has both secure and nonsecure content.
tags: URL

Render a form in a Modal Popup using ajax

Created 8 months ago by thiagoc7How-tos11 comments – viewed 22,704 times – ( +8 ) – version 2.0
Nowdays is very common webapps use this feature. With Yii2 this is very easy.
tags: yii2, AJAX, modal