Wiki articles

Showing 1-20 of 146 items.

UUID instead of an auto-increment integer for ID with Active Record

Created 14 days ago by grigori, updated 13 days ago by samdark.

bad design of Active Record.

1 0
2 followers
Viewed: 977 times
Version: 2.0
Category: How-tos

Yii v2 snippet guide

Created 2 months ago by rackycz, updated a month ago by rackycz.

Please note, that this article will be updated regularly as I have more and more snippets so come back in a few weeks

2 0
1 follower
Viewed: 13 902 times
Version: 2.0
Category: Tutorials

How to login from different tables in Yii2

Created a year ago by AndroideLP, updated 2 months ago by AndroideLP.

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

5 0
5 followers
Viewed: 24 156 times
Version: 2.0
Category: How-tos

Optimize Scenarios for yii2

Created 3 years ago by AndroideLP, updated 2 months ago by AndroideLP.

Working with scenarios, with models that can receive many modifications in their rules or structures as development evolves, can create disruptions in the rescue process.

4 0
2 followers
Viewed: 24 277 times
Version: 2.0
Category: Tutorials

Change default date format in Oracle

Created 2 months ago by lenovo, updated 2 months ago by samdark.

Default date format in Oracle is DD-MON-RR (25-JAN-18). With that output, we can't using date formatting.

0 0
2 followers
Viewed: 4 149 times
Version: 2.0
Category: How-tos
Tags: database

Move sources to src

Created 3 months ago by samdark, updated 3 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: 2 981 times
Version: 2.0
Category: How-tos

How to install Yii 2 advanced on a shared hosting environment

Created 4 years ago by oligalma, updated 4 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 504 times
Version: 2.0
Category: How-tos

Relational Query - Lazy Loading and Eager Loading in Yii 2.0

Created 3 years ago by softark, updated 5 months ago by samdark.

It's well known that there are Lazy Loading approach and Eager Loading approach in the relational query. But it's very important to know how the Eager Loading approach works in Yii 2. It has changed drastically from that of Yii 1.1, and there are common misunderstandings about it in the community.

4 0
5 followers
Viewed: 32 753 times
Version: 2.0
Category: Tutorials

How to send emails using SMTP

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

Nested Set with Yii2

Created 8 months ago by sangprabo, updated 8 months ago by sangprabo.

The nested set behaviour is an approach to store hierarchical data in relational databases. For example, if we have many categories for our product or items. One category can be a "parent" for other categories, means that one category consists of more than one category. The model can be drawn using a "tree" model. There are other approaches available but what we will learn in this article is speci...

5 0
3 followers
Viewed: 7 925 times
Version: 2.0
Category: Tutorials

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

Created 3 years ago by Wade Shuler, updated 8 months 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...

6 0
5 followers
Viewed: 21 549 times
Version: 2.0
Category: How-tos
2 0
3 followers
Viewed: 23 110 times
Version: 2.0
Category: How-tos

Events registration examples

Created 8 months ago by minitia, updated 8 months ago by minitia.

Register an event handler at Object-Level

1 0
2 followers
Viewed: 17 502 times
Version: 2.0
Category: How-tos
Tags: events, yii2

Filter & Sort by calculated/related fields in GridView Yii 2.0

Created 5 years ago by Kartik V, updated 9 months ago by softark.

This wiki explains how to add calculated fields into your Yii Framework 2.0 gridview with filtering and sorting.

12 2
64 followers
Viewed: 199 651 times
Version: 2.0
Category: Tutorials

Using multiple models in an identity

Created a year ago by samdark, updated 10 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
3 followers
Viewed: 18 716 times
Version: 2.0
Category: How-tos

Simple way to implement Dynamic Tabular Inputs

Created 4 years ago by ezekielnoob, updated 10 months ago by samdark.

grid

2 0
10 followers
Viewed: 30 833 times
Version: 2.0
Category: Tutorials

How to read HTML5 Multiple File Input from controller?

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

Remove Byte Order Mark (BOM) from files recursively

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

The problem was that all my web applications ran normally on localhost, but on server the Greek characters (or any other no-english characters) displayed with problems.

2 1
7 followers
Viewed: 24 827 times
Version: all
Category: How-tos

yii2-app-advanced on single domain (Apache, Nginx)

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

If you develop rather complex applications with Yii2, you might already be familiar with yii2-app-advanced application template. Well, the template is awesome and provides high flexibility regarding code/configuration sharing among parts of an application.

3 0
13 followers
Viewed: 96 220 times
Version: 2.0
Category: How-tos

Batch Gridview data ajax send splitted in chunks displaying bootstrap Progress bar

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

The scenario in which this wiki can be useful is when you have to send an (huge) array of model ids and perform a time consuming computation with it like linking every model to other models. The idea is to split the array into smaller arrays and perform sequential ajax requests, showing the calculation progress using a [Bootstrap Progress bar](https://www.yiiframework.com/extension/yiisoft/yii2-bo...

8 0
3 followers
Viewed: 13 821 times
Version: 2.0
Category: Tutorials