Wiki

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

How to use bizRules in standard accessControl filter

Created 4 years ago by Maciej LiżewskiHow-tos8 comments – viewed 15,205 times – ( +3 / -1 ) – version 1.1
I assume you are familiar with accessControl standard filter. It allows you to separate privileges to run some action from action code itself. There is however one problem with most common usage - you cannot use bizRules, at least based on some parameters passed to 'checkAccess' just because it is hard to pass them in accessRules() result.

Accessing data in a join table with the related models

Created 5 years ago by fsbHow-tos8 comments – viewed 113,181 times – ( +28 / -2 ) – version 1.1
Sometimes the right place to store application data is in a join table. For example, movie viewers either like or don’t like the movies they watched.

Use shortcut functions to reduce typing

Created 8 years ago by qiangTutorials8 comments – viewed 50,613 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.

custom sql query results to CDetailView

Created 3 years ago by Kostas Apazidis (KonApaz)How-tos8 comments – viewed 33,477 times – ( +3 / -1 ) – 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 6 years ago by zaccariaTips8 comments – viewed 58,221 times – ( +9 / -3 ) – 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 5 years ago by vibhaJadwaniHow-tos8 comments – viewed 79,650 times – ( +6 / -1 ) – 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 5 years ago by c@cbaTutorials8 comments – viewed 57,248 times – ( +7 / -1 ) – 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 6 years ago by Antonio RamirezHow-tos8 comments – viewed 65,514 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

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

Created 6 years ago by Steve FriedlHow-tos8 comments – viewed 50,728 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

CSqlDataProvider in CGridView

Created 3 years ago by Kostas Apazidis (KonApaz)Tutorials8 comments – viewed 24,194 times – ( +8 / -1 ) – version 1.1
In this wiki I will show how could use a CSqlDataProvider in CGridView with specific features