Sorted by viewsX
Displaying 521-530 of 779 result(s).

How to customize error handling in console-mode applications

Created 5 years ago by Steve FriedlHow-tos1 comment – viewed 11,394 times – ( +3 ) – version 1.1
One can control the detail of a web application in the webroot/index.php file by manipulating the values of YII_DEBUG and YII_TRACE_LEVEL, but these don't appear to be used by console applications. This is because although the base CApplication class defines a displayError() method that does consider these variable, CConsoleApplication overrides it with a function that doesn't honor them.

Yet another implementation of CPhpAuthManager.

Created 3 years ago by seenivasanHow-tos3 comments – viewed 11,374 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.

An important tip when you are using CArrayDataProvider.

Created 4 years ago by sirin kTips0 comments – viewed 11,360 times – ( +8 / -1 ) – version 1.1
Yii ‘s CArrayDataProvider is very helpful to display model relation data's directly on it.But it is truely a confusing one because by default it will assume a table field named “id” as primary key for its pagination purpose and what if you dont have field named “id” as primary key on your table? so its truely confusing and if you tried to display without an “id” field on ur table you will get an error like “ is not defined”.

Create Form With DynamicModel

Created 2 years ago by Misbahul D MunirTips4 comments – viewed 11,346 times – ( +2 ) – version 2.0
In yii2 we can create form without create FormModel. Here we go
tags: form, yii2, model

Building Page Specific Menus using CMenu

Created 3 years ago by mistrybHow-tos1 comment – viewed 11,299 times – version 1.1
The Yii Framework provides a sweet functionality that allows you to easily create page specific menus. What does this mean? This allows you to create one layout or CSS styling for your menu, and when each page is loaded, a new set of menu items is loaded in. This is useful for context specific sidebars within your application.
tags: CMenu

Rendering a view file in a console application

Created 4 years ago by TompiHow-tos1 comment – viewed 11,268 times – ( +4 / -2 ) – version 1.1
When someone want to send formatted HTML mails from a console application she/he will probably come across the problem of rendering view files.

Update specific cgridview html row after AJAX request

Created 2 years ago by Kostas Apazidis (KonApaz)How-tos3 comments – viewed 11,249 times – ( +2 ) – version 1.1
After of model update (successfull or not) throught CGridView (check the below link) you probably need to updates the specific row html in cgridview (not entire cgridview)

CGridView customized CCheckBoxColumn

Created 2 years ago by chandranTips2 comments – viewed 11,218 times – ( +5 ) – version 1.1
Hi friends,

How to obtain a grammatically correct translation of the model name in giix-generated view files

Created 4 years ago by c@cbaHow-tos0 comments – viewed 11,145 times – ( +4 ) – version 1.1
The giix code generator has out of the box i18n support for model names and attribute labels (besides other cool features > check it out!) . But I want to factor in not only the plural form, but also the grammatical cases (especially the accusative) while translating 'Manage Objects', 'Create Object', 'Edit Object' etc.

Extending CJuiDialog

Created 4 years ago by dstudioHow-tos0 comments – viewed 11,145 times – ( +2 / -2 ) – version 1.1
Sometimes you have CJuiDialog with different content but same buttons (or width, height). If you don't want to repeat yourself this is a great solution: