Wiki

Articles in category "how-tos", sorted by ratingX
Displaying 51-60 of 355 result(s).

Override/Eliminate Bootstrap CSS/JS for Yii 2.0 widgets

Created 3 years ago by Kartik VHow-tos2 comments – viewed 34,992 times – ( +38 / -5 ) – version 2.0
In Yii 2.0, the yii widgets that use Twitter Bootstrap CSS & JS directly, are part of the yii2-bootstrap extension, starting with yii/bootstrap namespace. For customizing bootstrap extension specific widget assets, you could configure your own assets (CSS/JS) using the new Yii Asset Manager in your Yii Config file. Something like:

How to log and debug variables using CWebLogRoute

Created 7 years ago by Antonio RamirezHow-tos8 comments – viewed 66,877 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 Yii with Nginx and PHP-FPM

Created 6 years ago by LericHow-tos10 comments – viewed 64,210 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.

Using International Dates

Created 6 years ago by Russell EnglandHow-tos4 comments – viewed 39,730 times – ( +18 / -1 ) – version 1.1
I needed British (dd/mm/yyyy) formatted dates throughout my application but found it very difficult to find examples of how to do this - until I found this excellent forum post http://www.yiiframework.com/forum/index.php?/topic/3649-dealing-with-i18n-date-formats/

Run Yiic directly from your app without a shell

Created 6 years ago by jacmoeHow-tos6 comments – viewed 37,176 times – ( +18 / -1 ) – version 1.1
Sometimes it would be nice if we could run yiic from an action, for example a migrate database button in our admin panel. Or because you are on a host which doesn't have shell access. Or maybe you are not allowed run popen or exec.

Write & use a custom Component in Yii2.0

Created 3 years ago by sirin kHow-tos4 comments – viewed 79,219 times – ( +18 / -1 ) – version 2.0
This is a simple example in Yii2.0 to understand how you can write a custom component and use it inside your app.(basic template)

Implementing cron jobs with Yii

Created 7 years ago by samdarkHow-tos6 comments – viewed 86,670 times – ( +33 / -4 ) – version 1.1
There are two ways to run a cron job:
tags: cron, cli

How to translate and do the translations the easy way

Created 6 years ago by Roman SolomatinHow-tos3 comments – viewed 71,349 times – ( +28 / -3 ) – version 1.1
I wanted to keep all the I18N related translations in separate files, so that I would not need to modify the view files or the model files every time I need to update or fix the translations of application's source language.

How to read HTML5 Multiple File Input from controller?

Created 3 years ago by Kartik VHow-tos1 comment – viewed 10,381 times – ( +37 / -5 ) – version all
Ok, so you have a HTML 5 file input markup on your view and you have enabled multiple attribute to true. You may also be using widgets based on HTML5 input like \kartik\widgets\FileInput. But when you read a file in Yii controller using CUploadedFile (Yii1) or UploadedFile (Yii2), you do not see a list of multiple files that you selected in your view, but only one row. Your HTML markup in your view would be something like this and you don't know why this is not working?

Getting the Most out of APC for Yii

Created 5 years ago by Da:SourcererHow-tos10 comments – viewed 39,337 times – ( +17 / -1 ) – version 1.1
The Advanced PHP Cache is a PHP extension which primarily serves as an opcode cache for PHP. The basic idea is to save PHP from re-evaluating the PHP code to intermediate bytecode on each request. Installing and enabling APC already yields a significant performance benefit. However, APC is not a black box that will magically change all for the better. More over it is important to understand that APC needs memory to operate.
tags: caching, apc