Wiki

Sorted by viewsX
Displaying 161-170 of 786 result(s).

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

Created 7 years ago by Steve FriedlHow-tos8 comments – viewed 51,867 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

Use shortcut functions to reduce typing

Created 8 years ago by qiangTutorials8 comments – viewed 51,552 times – ( +58 / -1 ) – 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.

Drills : Search by a HAS_MANY relation in Yii 1.1

Created 5 years ago by softarkTutorials13 comments – viewed 51,399 times – ( +34 / -1 ) – version 1.1
Sometimes we get lost trying to search by a HAS_MANY relation using CActiveRecord or CActiveDataProvider in Yii 1.1. This article is a series of drills that try to describe the practical techniques of searching by a HAS_MANY relation.

Importing CSV file to mysql table using "LOAD DATA" command.

Created 5 years ago by sirin kTips6 comments – viewed 51,286 times – ( +7 / -1 ) – version 1.1
hi, Here i am giving you some simple step to import huge data from a csv file to your mysql table.this is useful when you have a very huge data to import from csv format.
tags: csv, mysql, import

Reliable Alternative For Yii::app()->request->isAjaxRequest AND Adding Data To Ajax Form With JS

Created 6 years ago by ibo_sHow-tos2 comments – viewed 50,790 times – ( +15 / -2 ) – version 1.1
In this How-To I'll show you:

How to log changes of ActiveRecords?

Created 9 years ago by pfthTutorials7 comments – viewed 50,583 times – ( +41 / -3 ) – version 1.1
A simple and effective way to keep track what your users are doing within your application is to log their activities related to database modifications. You can log whenever a record was inserted, changed or deleted, and also when and by which user this was done. For a CActiveRecord Model you could use a behavior for this purpose. This way you will be able to add log functionality to ActiveRecords very easily.
tags: Logging

A simple way to get Yii client-side form validation run when submitting by ajax

Created 4 years ago by nlacTutorials5 comments – viewed 50,453 times – ( +8 / -3 ) – version 1.1
A time ago i've met the issue that Yii doesn't run any client-side form validation when submitting the form by CHtml::ajaxSubmitButton. The small javascript below helps to fix it.

Creating a database-driven hierarchical Structure combined with CMenu and superfish

Created 8 years ago by thyseusTutorials9 comments – viewed 50,398 times – ( +15 / -1 ) – version 1.1
Note: Please also take a look at the newer EMenu extension. This works even better that the deprecated CDropDownMenu!
tags: menu

Installation guide: Yii-2 advanced template with RBAC system

Created about a year ago by Sherin JoseTutorials3 comments – viewed 50,127 times – ( +13 / -3 ) – version 2.0
Welcome, all of you !
tags: install, yii2, rbac

CGridView: Update/create records in a CJuiDialog

Created 6 years ago by JobloTips12 comments – viewed 50,087 times – ( +14 / -1 ) – version 1.1
My article Display the full record in a CJuiDialog uses ajax to view a record in dialog on clicking the 'view-icon'.