Wiki

Articles in category "how-tos", sorted by viewsX
Displaying 41-50 of 355 result(s).

How to log and debug variables using CWebLogRoute

Created 7 years ago by Antonio RamirezHow-tos8 comments – viewed 66,904 times – ( +18 / -1 ) – version 1.1
I have seen a couple of articles about how to integrate external libraries to debug our PHP code (i.e. firePHP) but after you read this article you will realize that there is no need for such libraries when using Yii.
tags: Logging

Using standard filters in CGridView custom fields

Created 7 years ago by GOshaHow-tos4 comments – viewed 64,801 times – ( +17 / -1 ) – version 1.1
In this article I'll try to explain how to use standard quick search fields in CGridView with customized columns.For example: We have a record in a database with field switch having 0 or 1 values. After that we want a user to see on or off instead 1 or 0. So we do the usual thing:

How to use Multiple instances of the same model in the same form

Created 5 years ago by kiran sharmaHow-tos21 comments – viewed 64,593 times – ( +22 / -7 ) – version 1.1
When i had created this functionality then i found some difficulties and not got much idea from wiki and forums. so, i think this will be useful for newbie users and save time of other developers when create related functionality. I refer Collecting Tabular Input tutorial but not got clear idea for create/update.

Displaying image in a CGridView column.

Created 5 years ago by sirin kHow-tos5 comments – viewed 64,529 times – ( +13 / -2 ) – version 1.1
This is a simple example of how we can display images in CGridviews.Imagine that you have an image field in your table ie either a location field or a blob type field used to store the images.
tags: CGridView, image

Using Yii with Nginx and PHP-FPM

Created 6 years ago by LericHow-tos10 comments – viewed 64,232 times – ( +18 / -1 ) – version 1.1
This config is built on an Ubuntu 11.04 server. Software is nginx, php-fpm (php5-fpm). For performance, it's recommended to run php-fpm in SOCKET mode, instead of accessing via IP:PORT. That is the method shown below.

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

Created 2 years ago by Wade ShulerHow-tos2 comments – viewed 63,628 times – ( +18 / -2 ) – 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!

Integrating Wordpress and Yii: still another approach, using Yii as the router/controller

Created 5 years ago by acorncomHow-tos23 comments – viewed 63,530 times – ( +22 / -1 ) – version 1.1
A lot of people have written posts on integrating Yii and WordPress. This article combines goncin's approach with an article I read about integrating Symfony and WordPress and applies it all to Yii and WordPress.

How to use GridView with AJAX

Created 3 years ago by Antonio RamirezHow-tos6 comments – viewed 61,019 times – ( +14 / -1 ) – version 2.0
With the adoption of PJax on Yii2 things  have change quite a bit with GridView when it comes to work with them in AJAX mode. It will probably be confusing at the beginning, but then you will soon realize how powerful the new approach is.
tags: yii2, pjax, widget

How to implement cron in Yii 2

Created 3 years ago by hemcHow-tos10 comments – viewed 60,308 times – ( +11 / -1 ) – version 2.0
In advance template there is already a file yii. And there is no need to run it as php, it is Linux script.
tags: cron, yii2, console

How to validate CSRF token with session

Created 6 years ago by yangmlsHow-tos3 comments – viewed 59,801 times – ( +23 / -1 ) – version 1.1
First of all, You must change component config to enable the default Yii CSRF validation.
tags: CSRF, session