Wiki articles in category How-tos

Showing 1-20 of 72 items.

Displaying, Sorting and Filtering Model Relations on a GridView

Created 6 years ago by Antonio Ramirez, updated 6 years ago by Antonio Ramirez.

One of the things you will find tricky to implement is the the sorting and filtering of a GridView's column that displays related model data.

33 0
32 followers
Viewed: 269 239 times
Version: 2.0
Category: How-tos

Render Form in popup via AJAX (Create and Update) with ajax validation & Also load any page via ajax Yii 2.0 (2.3)

Created 5 years ago by skworden, updated 2 years ago by Yii3.

There are a few issues with the other solutions I originally used that I found from other wikis. I address the issues I had in this much simpler and shorter way. I am also going to explain what is going into way more detail than others to help people understand what's going on.

17 0
26 followers
Viewed: 198 097 times
Version: 2.0
Category: How-tos

Write & use a custom Component in Yii2.0

Created 5 years ago by sirin k, updated 2 years ago by Maurizio Domba Cerin.

This is a simple example in Yii2.0 to understand how you can write a custom component and use it inside your app.(basic template)

13 0
11 followers
Viewed: 103 445 times
Version: 2.0
Category: How-tos

How to use GridView with AJAX

Created 6 years ago by Antonio Ramirez, updated 2 years ago by CeBe.

With the adoption of PJax on Yii2 things  have change quite a bit with GridView when it comes to work with them in AJAX mode. It will probably be confusing at the beginning, but then you will soon realize how powerful the new approach is.

9 0
15 followers
Viewed: 74 124 times
Version: 2.0
Category: How-tos
Tags: pjax, widget, yii2

How to hide /frontend/web in url addresses on apache

Created 5 years ago by raminious, updated 5 years ago by jim..

There is an issue on Yii2 to redirecting / urls to /frontend/web.
In other words we need a way to hidden /frontend/web from addresses.
We will do this without changing Apache configuration and creating virtual host or setting document root (It's good for share hostings that we have not access to apache.conf)

9 0
20 followers
Viewed: 106 288 times
Version: 2.0
Category: How-tos

Tutorial about How to Integrate Yii2 with fantastic theme AdminLTE

Created 5 years ago by ThePr0f3550r, updated 5 years ago by YiiJeka.

Yii2 comes with a charming twitter bootstrap version 3. But if it is less, then you can integrate with web templates that you like. One example is wonderfull template "adminLTE"

8 0
21 followers
Viewed: 115 470 times
Version: 2.0
Category: How-tos

Move sources to src

Created 9 months ago by samdark, updated 9 months ago by samdark.

Yii 3 and many Yii 2 package sources are contained within src directory which is convenient since you have less directories to check.

8 0
4 followers
Viewed: 6 060 times
Version: 2.0
Category: How-tos

Yii2: How to create/develop a new extension using Composer locally without version control or Git

Created 3 years ago by Wade Shuler, updated a year ago by jwerner.

Using a version control system, like Git, is nice. However, when building an extension from scratch and loading it via Composer, it adds a lot of pain in the butt steps. You have to commit your changes, update composer to pull them over, then notice there is an error, fix, commit, update. repeat.. I don't want all my baby steps under Git. Sure, I could edit my commit history, but c'mon. Just let m...

7 0
6 followers
Viewed: 24 006 times
Version: 2.0
Category: How-tos

Yii2 - Upgrading to Bootstrap 4

Created 3 months ago by Richard Pillay, updated 2 months ago by Richard Pillay.

Yii2 - Converting from Bootstrap3 to Bootstrap4

7 0
5 followers
Viewed: 10 973 times
Version: 2.0
Category: How-tos

Pjax on ActiveForm and GridView - Yii2

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

Here is a example on how to use Pjax with GridView (yii\grid\GridView) and ActiveForm (yii\widgets\ActiveForm) widgets in Yii2.

6 0
15 followers
Viewed: 133 072 times
Version: 2.0
Category: How-tos

Use minified version of JqueryAsset, BootstrapAsset (and all default assets)

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

By default, Yii 2.0 chooses to use the non-minified version of Jquery and Bootstrap files (CSS and JS). However, there's a simple way to indicate Yii to use the minified version.

6 0
5 followers
Viewed: 26 353 times
Version: 2.0
Category: How-tos

Use kartik Growl with Yii2 flash messages

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

This is to show you how to use Yii2 flash messages with Kartik Growl (bootstrap notify wrapper).

6 0
10 followers
Viewed: 40 667 times
Version: 2.0
Category: How-tos

Pjax GridView: refresh page after delete

Created 2 years ago by hehbhehb, updated a year ago by CeBe.

Normally, after clicking the delete button in gridview, the record will be deleted and the page will refresh, but the page number in query string is lost. This is not always the case we expect.

6 0
4 followers
Viewed: 22 394 times
Version: 2.0
Category: How-tos

Upload files in Yii2 with MongoDb and GridFs

Created 6 years ago by edoardo849, updated 3 months ago by pceuropa.

Uploading files in a webapp can be extremely tricky and sometimes the quickest way to do it is to store the file directly in the webserver or into a DNS (like Amazon S3) and then to save the link and the metadata inside a table in the DB. The thing is that you'll have to deal with file permissions, server storage, file management and so on (which is perfectly fine, by the way).

6 0
6 followers
Viewed: 25 032 times
Version: 2.0
Category: How-tos

How to login from different tables in Yii2

Created 2 years ago by AndroideLP, updated 20 days ago by lenovo.

The Problem: Yii2 utilizes by default UserIdentity configured in config/web.php for connection, this object apply one table to authentication ('identityClass' => 'app\panel\models\User'). How to authentication from diferent tables? Solution: Create instances in web.php to uses UserIdentify. eg:

5 0
6 followers
Viewed: 28 856 times
Version: 2.0
Category: How-tos

How to send emails using SMTP

Created 6 years ago by robregonm, updated a year ago by Wade Shuler.
5 0
10 followers
Viewed: 102 299 times
Version: 2.0
Category: How-tos

Nested inline active fields inside Bootstrap horizontal forms

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

Are you using the Bootstrap 3 form styles with Yii 2 Active Forms? Have you faced problems in displaying complex layouts which needs you to display multiple inline form fields in a single row, within bootstrap horizontal forms. Then read on.

5 0
40 followers
Viewed: 49 998 times
Version: 2.0
Category: How-tos

Getting information from the current locale

Created a year ago by CeBe, updated a year ago by CeBe.

Yii 2.0 comes with a formatter component to format dates, numbers, and other values for international users according to their locale. This is very useful for displaying data. When working with incoming data or when using enhanced input methods like the [MaskedInput widget](https://www.yiiframework.com/doc/api/2.0/yii-widgets-maskedinp...

5 0
2 followers
Viewed: 12 070 times
Version: 2.0
Category: How-tos

How to implement form events

Created 5 years ago by Antonio Ramirez, updated 4 years ago by deacs.

You have that, when a product is on development they can change its API anytime. This change is quite important though, its related on how to set the events of your form, for example, the useful beforeSubmit.

5 0
6 followers
Viewed: 28 513 times
Version: 2.0
Category: How-tos
Tags: Forms, How to, yii2

Moving the vendor directory for multiple projects

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

This How-To is useful if you are planning to move the Yii vendor directory outside the default location.

4 0
4 followers
Viewed: 22 569 times
Version: 2.0
Category: How-tos