Wiki articles

Showing 101-120 of 147 items.

RBAC Super Simple with Admin and User

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

One of the common requests I see in the forum is how to implement RBAC. While you can implement Yii 2's built-in RBAC, that might be too much for developers who are just starting with Yii 2 or have simpler needs. Sometimes you are looking for a fast solution and just want two flavors, user and admin. And even if you will eventually need more, you can use these methods as a starting point for devel...

6 1
14 followers
Viewed: 82 228 times
Version: 2.0
Category: Tutorials

Using multiple models in an identity

Created a year ago by samdark, updated a year 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: 20 923 times
Version: 2.0
Category: How-tos

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

Running applications with Docker

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

When building PHP web applications you usually have to take care about defining and providing a consistent development and production environment for your team. This includes your application packages, PHP-extensions, database servers and often further components such as a mail server or workers.

4 0
8 followers
Viewed: 35 697 times
Version: 2.0
Category: Tutorials

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

Created 5 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.

4 0
13 followers
Viewed: 100 231 times
Version: 2.0
Category: How-tos

Single PHP entry point with Nginx

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

In this article I will show you how to slightly increase application security, by exploiting the fact that Yii implements the Front Controller Pattern.

4 0
3 followers
Viewed: 10 806 times
Version: all
Category: How-tos

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

Created 4 years ago by softark, updated 2 years ago by softark.

Assume we have many categories and many posts.

4 0
7 followers
Viewed: 33 885 times
Version: 2.0
Category: Tutorials

Optimize Scenarios for yii2

Created 3 years ago by AndroideLP, updated 5 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: 25 996 times
Version: 2.0
Category: Tutorials

Relational data fields display and edit with the yii2-detail-view extension

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

If you have read this wiki you would be aware of the yii2-detail-view extension and how it offers you an easy way to EDIT and VIEW your model data, toggle these modes, and other features. You can [read the extension documentation](http://demos....

4 0
41 followers
Viewed: 53 336 times
Version: 2.0
Category: Tutorials

Building a REST API in Yii2.0

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

This is wiki page is useful if you are trying to build a customized REST API in Yii2.0

4 0
16 followers
Viewed: 130 958 times
Version: 2.0
Category: Tutorials

Integrating ZF2 into Yii - use case demonstrated

Created 6 years ago by Boaz, updated 5 years ago by Boaz.

I needed to use a class from ZF2 in my Yii project. I've read probably all there is about this subject and still I needed lots of trial & errors to get it working, probably due to my lack of experience working with namepsaces and ZF2 in general. Also, the resources on the web are all partial, at best. Most simply refer to ZF1 where things are technically different. When I got it all working I de...

4 0
6 followers
Viewed: 10 642 times
Version: 2.0
Category: How-tos

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

Created 4 months ago by grigori, updated 2 months ago by grigori.

bad design of Active Record.

4 0
3 followers
Viewed: 7 051 times
Version: 2.0
Category: How-tos

Installation guide: Yii-2 advanced template with RBAC system

Created 3 years ago by Sherin Jose, updated 3 years ago by Sherin Jose.

Welcome, all of you !

8 1
19 followers
Viewed: 89 540 times
Version: 2.0
Category: Tutorials
Tags: install, rbac, yii2

How to login from different tables in Yii2

Created a year ago by AndroideLP, updated 5 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: 26 768 times
Version: 2.0
Category: How-tos

How to send emails using SMTP

Created 5 years ago by robregonm, updated 11 months ago by Wade Shuler.
5 0
10 followers
Viewed: 99 927 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 455 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: 11 387 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: 27 951 times
Version: 2.0
Category: How-tos
Tags: Forms, How to, yii2

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

Created 5 years ago by Anas AbuDayah, updated 4 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: 79 136 times
Version: 2.0
Category: Tutorials

Nested Set with Yii2

Created a year ago by sangprabo, updated 11 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: 15 434 times
Version: 2.0
Category: Tutorials