Wiki

Articles in category "how-tos", sorted by ratingX
Displaying 161-170 of 342 result(s).

MongoDb's embedded documents mapping for ActiveRecord in Yii2

Created about a year ago by edoardo849How-tos2 comments – viewed 7,164 times – ( +5 ) – version 2.0
You are working with MongoDb and you have embedded documents in your collection that you want to easily map in your Model for CRUD operations.

How to use EzComponents in Yii

Created 4 years ago by EhsanjsHow-tos0 comments – viewed 8,073 times – ( +5 ) – version 1.1
change your index.php

Using updateAll and deleteAll with scopes

Created about a year ago by le_topHow-tos4 comments – viewed 14,556 times – ( +5 ) – version 1.1
Using CActiveRecord->updateAll() and CActiveRecord->deleteAll() with scopes and criteria requires some tricks that are explained in this article. While findAll() , find() and some other methods use scopes automatically, updateAll() and deleteAll() do not.

Alternative folder structure for a standard Yii app

Created 2 years ago by TrejderHow-tos4 comments – viewed 10,833 times – ( +5 ) – version 1.1
I found a standard Yii app's protected folder structure nearly perfect. With a few simple moves and a little bit change to the code, I managed to bring it to the level, which I found as fully perfect. I want to share my point of view, in case someone would like to use this structure as well.

How to provide a fallback or mapping for translation messages?

Created 2 years ago by schmunkHow-tos1 comment – viewed 4,407 times – ( +5 ) – version 1.1
Sometimes you want to use exisiting translations for locales, which do not directly match. An example would be a website targeting Germany (de_de), Austria (de_at) and Switzerland (de_ch, fr_ch, it_ch). Although you may have exisiting translations for German (de), French (fr) and Italian (it), there are problems using it directly.

Popup AJAX DialogBox without any extension

Created 2 years ago by Kostas Apazidis (KonApaz)How-tos6 comments – viewed 16,037 times – ( +8 / -1 )
In this wiki I explain how to show a default popup dialogbox (like Gii does) using an existing module.

How to use Expression in default AccessControl to allow only the owner to do some action

Created 2 years ago by whatifHow-tos2 comments – viewed 25,092 times – ( +8 / -1 ) – version 1.1
Hi Everyone

[Guide] How to actually separate Frontend (User) and Backend (Admin) on Yii2 Advanced

Created 3 months ago by Wade ShulerHow-tos1 comment – viewed 10,900 times – ( +8 / -1 ) – version 2.0
I am writing this guide because I struggled to find a resource that included ALL of the necessary steps to completely separate the frontend from the backend. After reading guides like Configuring different sessions for backend and frontend in yii-advanced-app and yii2 configuring different sessions for backend and frontend in yii advanced application template, there are still steps missing. It is funny how the 2nd one says it is an extension of the first one's article. So I guess, my wiki guide here is yet a 3rd and more complete extension of both of them. I also found a few StackOverflow questions and blog posts regarding this topic. None of them fully worked, and must be missing some magic sauce!

Yet another implementation of CPhpAuthManager.

Created 2 years ago by seenivasanHow-tos3 comments – viewed 9,805 times – ( +8 / -1 ) – version 1.1
In this wiki, I try to implement a simple authorization schema without putting much logic inside a file or into database table. We are constructing authorization hierarchy inside the controller. We are getting roles for the current user from database table and assigning only roles to user that are declared in the particular controller. We have brought down the work of loading of auth data at main application level to controller level. This way we have pulverised auth data for entire site into smaller units. Finally we are going to look at couple of examples.

How to write a simple application component

Created 4 years ago by zaccariaHow-tos5 comments – viewed 47,173 times – ( +20 / -7 ) – version 1.1
An application component is a confortable way for share information among all component of the application