Sorted by commentsX
Displaying 121-130 of 779 result(s).

Use shortcut functions to reduce typing

Created 7 years ago by qiangTutorials8 comments – viewed 48,611 times – ( +58 ) – version 1.1
Because Yii intends to be integrated nicely with third-party libraries, it does not define any global functions. Everything in Yii needs to be addressed with full class name or object scopes. For example, to access the current user, we need to use Yii::app()->user; to access application parameters, we need Yii::app()->params['name']; and so on. While editors like textmate can help alleviate the problem of these lengthy typings, it is worthwhile to define global shortcut functions to some commonly used method calls. They will make the application code look cleaner.

Render Form in popup via AJAX (Create and Update) with ajax validation & Also load any page via ajax Yii 2.0 (2.3)

Created about a year ago by skwordenHow-tos8 comments – viewed 83,331 times – ( +26 ) – version 2.0
There are a few issues with the other solutions I originally used that I found from other wikis. I address the issues I had in this much simpler and shorter way. I am also going to explain what is going into way more detail than others to help people understand what's going on.

custom sql query results to CDetailView

Created 3 years ago by Kostas Apazidis (KonApaz)How-tos8 comments – viewed 30,946 times – ( +3 ) – version 1.1
This is a bried guide about displaying of custom sql query results.

Saving files to a blob field in the database

Created 5 years ago by zaccariaTips8 comments – viewed 55,004 times – ( +9 / -2 ) – version 1.1
As a follow-up from the How to upload a file using a model wiki entry that explains how to save a file to the filesystem, this article will do the same using a blob field in the database.
tags: File upload

How to create front and admin side login form

Created 4 years ago by vibhaJadwaniHow-tos8 comments – viewed 74,047 times – ( +6 ) – version 1.1
In this WIKI you can learn how to create front and admin login form, using database.

Custom Number Formatting or Decimal Separators and i18n

Created 4 years ago by c@cbaTutorials8 comments – viewed 51,956 times – ( +7 ) – version 1.1
By default, the decimal separator in php (also in mysql) is a dot (.). So when we work with floats in Yii (in calculations, validation, sql statements etc.), the decimal separator has to be a dot. If we want to use for example a comma (,) as the decimal separator, that is if we want to display numbers and enable users to enter numbers with a comma before the decimals, we have to...

How to log and debug variables using CWebLogRoute

Created 5 years ago by Antonio RamirezHow-tos8 comments – viewed 61,918 times – ( +18 ) – 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

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

Created 5 years ago by Steve FriedlHow-tos8 comments – viewed 48,311 times – ( +22 / -1 ) – 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

CSqlDataProvider in CGridView

Created 2 years ago by Kostas Apazidis (KonApaz)Tutorials8 comments – viewed 20,673 times – ( +8 ) – version 1.1
In this wiki I will show how could use a CSqlDataProvider in CGridView with specific features

Displaying, sorting and filtering HasMany & ManyMany relations in CGridView

Created 4 years ago by yJeroenTutorials8 comments – viewed 56,612 times – ( +21 ) – version 1.1
This tutorial gives you multiple options of how to fully implement showing, sorting and filtering related data in gridviews.