Wiki

Articles in category "how-tos", sorted by ratingX
Displaying 61-70 of 348 result(s).

How to translate and do the translations the easy way

Created 4 years ago by Roman SolomatinHow-tos3 comments – viewed 58,522 times – ( +28 / -2 ) – 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.

Drop down list with enum values for column of type ENUM >+> incorporate into giix

Created 4 years ago by c@cbaHow-tos3 comments – viewed 30,961 times – ( +14 ) – version 1.1
Let's say our table 'mug' has a column named 'color' of the type ENUM('red','green','blue'). We want to replace the textfield for the attribute color in the create and update forms of a 'mug' with a drop down list, which has the enum values as options. The main code was contributed by zaccaria in the forum (see this post).

How to use GridView with AJAX

Created about a year ago by Antonio RamirezHow-tos6 comments – viewed 32,447 times – ( +14 ) – 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

Using Bootstrap with LESS

Created 3 years ago by Chris83How-tos1 comment – viewed 40,965 times – ( +14 ) – version 1.1
I discovered Twitter Bootstrap almost two years ago. After trying it out for a while I fell in love with it. It didn't take long before I realized that it would be great to write an extension that allowed developers to start using Bootstrap in their Yii projects. One night I sat down and started writing what later became my now popular bootstrap extension. Now that the extension is quite widely used in the community I felt that it was time to write about how to use Bootstrap to its full potential. If you use the Bootstrap CSS files you're really missing out on some great features. After reading this article you'll be able to take full advantage of Bootstrap using LESS.

Integrating HybridAuth directly into Yii without an extension

Created 2 years ago by biz devHow-tos8 comments – viewed 34,104 times – ( +14 ) – version 1.1
This article tries to explain the steps required in integrating the HybridAuth into Yii directly, without using an extension.

How to hide /frontend/web in url addresses on apache

Created about a year ago by raminiousHow-tos13 comments – viewed 53,258 times – ( +14 ) – version 2.0
There is an issue on Yii2 to redirecting / urls to /frontend/web. In other words we need a way to hidden /frontend/web from addresses. We will do this without changing Apache configuration and creating virtual host or setting document root (It's good for share hostings that we have not access to apache.conf)

Kickstart development with Yii-App

Created 3 years ago by Chris83How-tos25 comments – viewed 28,684 times – ( +21 / -1 ) – version 1.1
I recently created a project called Yii-App on GitHub to kickstart my development of smaller Yii applications. The main goal of the project is to provide a ready-to-use application template that includes my bootstrap extension and many other useful extensions. After reading this article you will be able to use this project as a starting point for all of your Yii projects.

Override/Eliminate Bootstrap CSS/JS for Yii 2.0 widgets

Created about a year ago by Kartik VHow-tos2 comments – viewed 20,933 times – ( +38 / -4 ) – 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 read HTML5 Multiple File Input from controller?

Created about a year ago by Kartik VHow-tos1 comment – viewed 6,352 times – ( +37 / -4 ) – 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?

Using loginRequiredAjaxResponse to solve ajax session timeout

Created 3 years ago by RutgerHow-tos3 comments – viewed 23,635 times – ( +13 ) – version 1.1
This solution requires Yii 1.1.9 or above