Wiki articles

Showing 301-320 of 822 items.

Simple Ajax popup

Created 10 years ago by Rajith R, updated 9 years ago by Rajith R.

Simple Ajax popup view with Ajax link

5 0
9 followers
Viewed: 51 370 times
Version: 1.1
Category: Tutorials

Searching and sorting by related model in CGridView

Created 12 years ago by Maciej Liżewski, updated 9 years ago by Kostas Apazidis (KonApaz).

Lets say we have two models and relation between them:

77 0
93 followers
Viewed: 274 304 times
Version: 1.1
Category: Tutorials

Update specific cgridview html row after AJAX request

Created 9 years ago by Kostas Apazidis (KonApaz), updated 9 years ago by Kostas Apazidis (KonApaz).

After of model update (successfull or not) throught CGridView (check the below link) you probably need to updates the specific row html in cgridview (not entire cgridview)

1 0
2 followers
Viewed: 23 472 times
Version: 1.1
Category: How-tos
1 0
6 followers
Viewed: 64 482 times
Version: 1.1
Category: Tips

Insert a model record using CGridview

Created 10 years ago by Kostas Apazidis (KonApaz), updated 10 years ago by Kostas Apazidis (KonApaz).

CGridview displays existent rows of the table (using DataProvider)

2 0
1 follower
Viewed: 17 593 times
Version: 1.1
Category: How-tos

Update related models of a model using listBox and checkBoxList in the form

Created 10 years ago by Kostas Apazidis (KonApaz), updated 10 years ago by Kostas Apazidis (KonApaz).

Suppose you want to have a list in Category with its related products and you want to updates the list (removing or insert product items) This wiki show us how to do that

1 0
1 follower
Viewed: 23 561 times
Version: 1.1
Category: How-tos

Generate CTreeview from database table and update a model

Created 10 years ago by Kostas Apazidis (KonApaz), updated 10 years ago by Kostas Apazidis (KonApaz).

Suppose we want to set a category to product (or an item in general term), Also suppose categories has sub-categories (multi-level)

1 0
1 follower
Viewed: 13 665 times
Version: 1.1
Category: How-tos

Generate a multi-lever array sub-category for a menu

Created 10 years ago by Kostas Apazidis (KonApaz), updated 10 years ago by Kostas Apazidis (KonApaz).

Everyone have seen a multilayer menu in several CMS

7 0
8 followers
Viewed: 27 079 times
Version: 1.1
Category: How-tos

Visualization tree-multi subcategories as listbox or dropdownlist

Created 10 years ago by Kostas Apazidis (KonApaz), updated 10 years ago by Kostas Apazidis (KonApaz).

Do you want to make a listbox or dropdownlist to select one or more categories or sub categories ?

4 0
4 followers
Viewed: 27 919 times
Version: 1.1
Category: How-tos

Managing your nested dropdown dependency with DepDrop widget

Created 10 years ago by Kartik V, updated 10 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
42 followers
Viewed: 87 854 times
Version: 2.0
Category: Tutorials

How to Reuse File Upload Code via Behavior

Created 10 years ago by Ahamed Rifaideen, updated 10 years ago by Ahamed Rifaideen.

hello guys now i am going to show you how to Reuse File Upload Code across multiple projects.

1 0
1 follower
Viewed: 10 784 times
Version: 1.1
Category: How-tos

How to store array/widget configuration to the database with config validation rules

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

Note the tag {{homeUrl}} will be dynamically replaced at runtime.

2 3
41 followers
Viewed: 23 773 times
Version: 2.0
Category: Tutorials
1 3
3 followers
Viewed: 10 446 times
Version: 1.1
Category: How-tos

Managing a star rating with the StarRating widget in Yii 2

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

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.

1 3
41 followers
Viewed: 24 193 times
Version: 2.0
Category: How-tos

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

Created 10 years ago by Kartik V, updated 10 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: 43 480 times
Version: 2.0
Category: Tips

Locking your Yii 2 project package versions with composer.lock

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

Ok, you have installed a Yii 2 basic or advanced app for the first time and completed the post install steps. You have picked up a few extensions to install for the first time as well. You would already see a composer.lock file in your application root folder.

0 2
37 followers
Viewed: 16 688 times
Version: 2.0
Category: Tips

My Own Components Folder in Yii2

Created 10 years ago by CTala, updated 10 years ago by CTala.

In Yii1 I used to have my own components under the components folder of the structure, now with namespacing this is a little bit different.

2 1
2 followers
Viewed: 20 897 times
Version: 2.0
Category: Tips

FORM with GET method causes repeated stacking of URL Parameters

Created 10 years ago by Kartik V, updated 10 years ago by toph.

// In Yii 1.x $form = $this->beginWidget('CActiveForm', [

'id' => 'order-search-form',
'method' => 'get',

]); echo $form->textInput($searchModel, 'id'); echo CHtml::submitButton('Find', ['class' => 'btn btn-primary']); $this->endWidget(); `

7 2
41 followers
Viewed: 61 652 times
Version: all
Category: Tips

Overcoming removal of client helpers (e.g. ajaxLink) and ClientScript in Yii 2.0

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

Alternatively, inline assets (JS/CSS) can be registered at runtime from within the View. For example you can clearly simulate the ajaxLink feature using a inline javascript. Its however recommended if you can merge where possible, client code (JS/CSS) into separate JS/CSS files and loaded through the AssetBundle. Note there is no more need of a CClientScript anymore:

1 2
41 followers
Viewed: 43 536 times
Version: 2.0
Category: FAQs

What to do when composer fails to update your vendor packages?

Created 10 years ago by Kartik V, updated 10 years ago by Kartik V.
  • Running a composer update does not fetch any new packages (even though the source is updated)
  • A specific vendor package never gets updated
  • Facing on and off problems when fetching packages while performing composer update.
  • You ran a composer update earlier, but it was partially done, before you lost network connectivity, and you cannot refresh packages anymore.
0 4
36 followers
Viewed: 49 771 times
Version: 2.0
Category: Tutorials