Wiki

Sorted by ratingX
Displaying 151-160 of 784 result(s).

How to read HTML5 Multiple File Input from controller?

Created 3 years ago by Kartik VHow-tos1 comment – viewed 9,344 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?

Locking your Yii 2 project package versions with composer.lock

Created 3 years ago by Kartik VTips0 comments – viewed 5,942 times – ( +37 / -5 ) – version 2.0
Ok, you have installed a Yii 2 basic or advanced app for the first time and completed the post install steps. You have picked up a few extensions to install for the first time as well. You would already see a composer.lock file in your application root folder.

Special $variables in CGridView and CListView

Created 5 years ago by Steve FriedlTips11 comments – viewed 64,528 times – ( +27 / -3 ) – version 1.1
The popular CListView and CGridView widgets each take a data provider and iterate over each data object produced, calling the user's code to render each row one at a time, and most are familiar with the use of the $data variable to represent the current model object or array.

Handling tabular data loading and validation in Yii 2

Created 3 years ago by Kartik VTutorials7 comments – viewed 38,748 times – ( +44 / -7 ) – version 2.0
How do you read and handle tabular data submission via form in Yii framework 2.0? Sometimes we want to collect user input in a batch mode. That is, the user can enter the information for multiple model instances and submit them all at once. We call this tabular input because the input fields are often presented in an HTML table.

Relational Query - Lazy Loading and Eager Loading in Yii 1.1 / with and together

Created 4 years ago by softarkTutorials11 comments – viewed 39,841 times – ( +17 / -1 ) – version 1.1
It's well known that there are Lazy Loading approach and Eager Loading approach in the relational query. But it's important to note that you should distinguish 2 different modes in the Eager Loading in Yii 1.1.x.

Manage application configuration in different modes

Created 8 years ago by qiangTutorials5 comments – viewed 38,710 times – ( +17 / -1 ) – version 1.1
Info: This tutorial references the idea presented in Jonah's excellent blog article.

Getting the Most out of APC for Yii

Created 5 years ago by Da:SourcererHow-tos10 comments – viewed 38,355 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

Using standard filters in CGridView custom fields

Created 6 years ago by GOshaHow-tos4 comments – viewed 63,288 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:

CListView AJAX filtering

Created 6 years ago by DragaTutorials17 comments – viewed 63,966 times – ( +17 / -1 ) – version 1.1
This tutorial shows how to filter CListView items by AJAX, and it's compatible with disabled JavaScript users In my case this has been done to filter users list

Moving project code outside of webroot (plus multiple project support)

Created 6 years ago by Steve FriedlHow-tos8 comments – viewed 50,562 times – ( +22 / -2 ) – version 1.1
Yii's by-default directory organization works well enough, but there are several steps one can take that improve the security and serviceability of the system, especially in the context of multiple Yii projects on the same machine (including multiple versions of the same project).
tags: config, security