Wiki articles

Showing 101-120 of 145 items.

Upload files in Yii2 with MongoDb and GridFs

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

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
5 followers
Viewed: 23 801 times
Version: 2.0
Category: How-tos

How to send emails using SMTP

Created 5 years ago by robregonm, updated 6 months ago by Wade Shuler.
5 0
10 followers
Viewed: 94 298 times
Version: 2.0
Category: How-tos

Yii2 default values for Index data Provider

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

Guys,

1 0
5 followers
Viewed: 25 142 times
Version: 2.0
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.

10 3
47 followers
Viewed: 138 125 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 535 times
Version: all
Category: Tips

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 274 times
Version: 2.0
Category: How-tos

How to use imagine ( crop, thumb, effects for images ) on Yii2

Created 5 years ago by Anas AbuDayah, updated 3 years ago by Cozumel.

Imagine adds most common image functions and also acts as a wrapper to Imagine image manipulation library.

5 0
13 followers
Viewed: 75 356 times
Version: 2.0
Category: Tutorials

Drills : Search by a HAS_MANY relation in Yii 2.0

Created 4 years ago by softark, updated a year ago by softark.

This article tries to describe the practical techniques of searching by a HAS_MANY relation using ActiveRecord of Yii 2.0.

11 0
12 followers
Viewed: 76 579 times
Version: 2.0
Category: Tutorials

How to install Yii 2 advanced on a shared hosting environment

Created 3 years ago by oligalma, updated 3 months ago by oligalma.

I've read many comments that it's not possible to install Yii 2 advanced on a shared hosting environment, as it has two webroots. This is partially true.

3 0
2 followers
Viewed: 24 136 times
Version: 2.0
Category: How-tos

Simple Jui Autocomplete in yii2

Created 3 years ago by ajith, updated 3 years ago by ajith.

To use jui auto complete widget first add

0 0
3 followers
Viewed: 33 435 times
Version: 2.0
Category: Tutorials

How to create/update a model with its related items using Listbox or CheckboxList

Created 3 years ago by softark, updated a year ago by softark.

Assume we have many categories and many posts.

3 0
6 followers
Viewed: 30 207 times
Version: 2.0
Category: Tutorials

How to make bootstrap tabs remain active/selected after navigating to different web pages.

Created 3 years ago by emrald, updated 3 years ago by emrald.

Bootstrap tabs gets unselected/inactive when user navigates to other page and comes back. How to make bootstrap tabs remain active/selected after navigating to different web pages.

1 0
3 followers
Viewed: 9 721 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 719 times
Version: 2.0
Category: Tutorials

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 663 times
Version: 2.0
Category: How-tos

An alternative way to ElasticSearch

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

This article is for those who have dealt with the complexity of Elasticsearch or any other indexing machines and are looking for an easier way to index the existing database without additional effort.

1 0
2 followers
Viewed: 7 788 times
Version: all
Category: How-tos

Creating a Dependent Dropdown From Scratch in Yii2

Created 5 years ago by ThePr0f3550r, updated a year ago by alrazi.

I have read http://www.yiiframework.com/wiki/24/creating-a-dependent-dropdown/ (Dependen Dropdown Yii1), but I can't implement it in Yii2 because Yii2 does not have built-in AJAX functionality hem.. I searched about it and came across this post

3 1
11 followers
Viewed: 105 889 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)

12 0
11 followers
Viewed: 98 852 times
Version: 2.0
Category: How-tos

How to implement form events

Created 5 years ago by Antonio Ramirez, updated 3 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: 26 818 times
Version: 2.0
Category: How-tos
Tags: Forms, How to, yii2

Using multiple models in an identity

Created a year ago by samdark, updated 8 months ago by samdark.

Let's assume we have two models: Customer and Supplier and we want both to log in. Yii is quite flexible when it comes to authentication and authorization so it's possible.

8 2
2 followers
Viewed: 17 636 times
Version: 2.0
Category: How-tos

Create Form With DynamicModel

Created 5 years ago by Misbahul D Munir, updated 5 years ago by Misbahul D Munir.

In yii2 we can create form without create FormModel. Here we go

2 0
7 followers
Viewed: 32 156 times
Version: 2.0
Category: Tips
Tags: form, model, yii2