Wiki

Articles in category "how-tos", sorted by ratingX
Displaying 201-210 of 322 result(s).

How to customize error handling in console-mode applications

Created 4 years ago by Steve FriedlHow-tos1 comment – viewed 8,947 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.

MongoDb's embedded documents mapping for ActiveRecord in Yii2

Created 10 months ago by edoardo849How-tos1 comment – viewed 4,407 times – ( +3 ) – 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 limit number of guest page views

Created 10 months ago by PeRoChAkHow-tos1 comment – viewed 3,104 times – ( +3 ) – version 1.1
In some cases, we have to limit the number of page views for the guests users. Yii provide an efficient method to get this.

How to use BootstrapInterface

Created 8 months ago by Antonio RamirezHow-tos0 comments – viewed 2,274 times – ( +3 ) – version 2.0
Yii2 introduces the BootstrapInterface to ease our application initialization tasks, whether they are composer based or Application bootstrap (do not mistaken with Bootstrap CSS Framework) based tasks. On this article, I am going to explain how to use it on your Application bootstrap process.

Open bootstrap modal and load content via Ajax

Created 8 months ago by JbalTeroHow-tos1 comment – viewed 17,694 times – ( +3 ) – version 1.1
My goal here is to Open bootstrap modal and load ANY content using ajax response.

Localized version of CFormatter

Created 2 years ago by marcovtwoutHow-tos2 comments – viewed 3,835 times – ( +3 ) – version 1.1
Since Yii 1.1.14, a CLocalizedFormatter is available.

Handling recursive deletion in Yii

Created 2 years ago by JamesBarnsleyHow-tos3 comments – viewed 7,174 times – ( +3 ) – version 1.1
As a lead developer at Mutable Labs I was tasked to find a way to do recursive deletion in Yii. As I asked other developers and looked around the internet the usual answers all came up, use a plugin or use cascade delete at the DB level, but I did not want to do either of these.

How to use the official Yii installer for Composer (**DEPRECATED**)

Created about a year ago by br0skHow-tos9 comments – viewed 14,115 times – ( +3 ) – version 1.1
This wiki shall be considered deprecated since the Yii installer for composer has been discontinued.

How to change Migration Table name and use defined prefix.

Created about a year ago by JorgeeHow-tos1 comment – viewed 6,224 times – ( +3 ) – version 1.1
To accomplish the task of changing Migration table's name, by default tbl_migration, you need to add the following in your ./protected/config/console.php.

Profiling using XDebug

Created about a year ago by le_topHow-tos1 comment – viewed 5,995 times – ( +3 ) – version all
A short explication on how to extract profile information for PHP on your server using XDebug and KCacheGrind or WinCacheGrind.