Showing 121-140 of 827 items.

How to nest DB transactions without actually nesting them.

Created 11 years ago by le_top le_top, updated 11 years ago by le_top le_top. 0 comments

To secure your database from inconsistencies resulting from failing (complex) operations, you (should) use transactions. However, complex methods often rely on other complex methods that themselves build on transactions. This HowTo presents a method to nest or embed transactions without relying on the database's nesting capabilities.

1 0
1
Viewed: 14 564 times
Version: 1.1
Category: How-tos

RBAC Super Simple with Admin and User

Created 11 years ago by evercode evercode, updated 11 years ago by evercode evercode. 13 comments

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

9 1
15
Viewed: 111 341 times
Version: 2.0
Category: Tutorials

Use CGridview to sort and filter CSqlDataProvider - when used with UNRELATED tables (or complex queries)

Created 11 years ago by Gerhard Liebenberg Gerhard Liebenberg, updated 11 years ago by Gerhard Liebenberg Gerhard Liebenberg. 6 comments

I have two tables called hospitals and departments. I have a junction table between them which holds the departments in each hospital. But sometimes I need a list of "All hospitals with All possible departments" - regardless of whether they are linked in the junction table or not.

0 0
3
Viewed: 27 395 times
Version: 1.1
Category: How-tos

Yii configuration: Dynamic & User dependent

Created 11 years ago by le_top le_top, updated 11 years ago by le_top le_top. 0 comments

It is difficult to perform user dependent theming through a general configuration in 'main.php'. This article proposes a method to do so through a Factory that dynamically generates classes to allow delayed resolution of actual user values. This means that you can refer to values that are stored in the database through the CActiveRecord before Yii is actually loaded. The values will be fetched...

1 0
1
Viewed: 16 287 times
Version: 1.1
Category: How-tos

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

Created 11 years ago by raminious raminious, updated 11 years ago by jim. jim.. 17 comments

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)

11 0
22
Viewed: 136 867 times
Version: 2.0
Category: How-tos