Wiki articles

Showing 101-120 of 145 items.

Using the yii2-datecontrol extension along with yii2-detail-view widget

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

The yii2-datecontrol extension allows you to control separate date formats for display and saving for form inputs.

1 0
37 followers
Viewed: 15 221 times
Version: 2.0
Category: How-tos

Editing, Deleting, and Viewing model data with the yii2-detail-view extension

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

The yii2-detail-view extension offers you an easy way to EDIT and VIEW your model data, toggle these modes, and adds other features. You can read the extension documentation and/or view a demo of this extension, to understand usage.

1 0
43 followers
Viewed: 67 198 times
Version: 2.0
Category: Tutorials

Configuring different sessions for backend and frontend in Yii advanced app

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

Your need: You require that for shared machines, the user is authenticated again for a backend access again, if someone is logged in from frontend and vice versa.

3 0
46 followers
Viewed: 37 024 times
Version: 2.0
Category: How-tos

Save and Display Date/Time Fields in different formats in Yii2

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

You would find having such a need in most Yii Projects. Your database needs a specific format to store date fields, while you may want to display it in different formats to the users on forms and other views.

0 0
51 followers
Viewed: 145 353 times
Version: 2.0
Category: How-tos

Filter & Sort by Summary Data in GridView Yii 2.0

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

This wiki explains how to add summary data from related models into your Yii Framework 2.0 gridview with filtering and sorting by the summary columns.

5 2
49 followers
Viewed: 57 643 times
Version: 2.0
Category: Tutorials

Displaying uploaded file from DB for update with FileInput widget

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

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?

1 3
42 followers
Viewed: 47 450 times
Version: 2.0
Category: How-tos

Managing a star rating with the StarRating widget in Yii 2

Created 5 years ago by Kartik V, updated 5 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: 16 754 times
Version: 2.0
Category: How-tos

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 210 times
Version: 2.0
Category: Tutorials

Using your own forked version of extensions with composer

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

So you want to use a fork of any existing vendor extension with your Yii 2 install and use the fork, instead of original source. This does not need you to push any update or register your package on packagist.org. You are recommended to follow the approach below:

3 2
40 followers
Viewed: 16 898 times
Version: 2.0
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 239 times
Version: 2.0
Category: Tips

Locking your Yii 2 project package versions with composer.lock

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

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

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

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

0 3
40 followers
Viewed: 13 351 times
Version: 2.0
Category: Tutorials

My Own Components Folder in Yii2

Created 5 years ago by CTala, updated 5 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: 14 999 times
Version: 2.0
Category: Tips

FORM with GET method causes repeated stacking of URL Parameters

Created 5 years ago by Kartik V, updated 5 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(); `

4 2
40 followers
Viewed: 45 988 times
Version: all
Category: Tips

Yii 2 list of path aliases available with default basic and advanced app.

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

If you are coming over from Yii 1.x to Yii 2, and already read this guide, you may note that namespaces are very important in Yii 2 to identify classes. But do you know the list of seeded path aliases that come shipped with a basic or advanced app? Here is my attempt to list them.

11 3
47 followers
Viewed: 139 249 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 506 times
Version: 2.0
Category: Tutorials

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

Created 5 years ago by Kartik V, updated 5 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:

0 2
40 followers
Viewed: 33 487 times
Version: 2.0
Category: FAQs

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: 52 919 times
Version: 2.0
Category: Tips

Yii2 default values for Index data Provider

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

Guys,

2 0
5 followers
Viewed: 25 264 times
Version: 2.0
Category: Tips

How to read HTML5 Multiple File Input from controller?

Created 5 years ago by Kartik V, updated 9 months ago by samdark.
0 2
40 followers
Viewed: 13 882 times
Version: 2.0
Category: How-tos