Wiki articles

Showing 61-80 of 799 items.

Set a menu - reusable code

Created 5 years ago by Kostas Apazidis (KonApaz), updated 5 years ago by Kostas Apazidis (KonApaz).

As we know Using crud generator creates menu items in view files (for each view file have a varius menu items)

1 0
3 followers
Viewed: 8 727 times
Version: Unknown (update)
Category: Tips

Yii 1.1.17 Ubuntu AutoInstall Bash Script

Created 3 years ago by Preacher, updated 3 years ago by Preacher.

Just thought I would share this bash script I wrote to help automate a base install of YII on an Ubuntu server. This script does the following:

1 1
1 follower
Viewed: 8 820 times
Version: 1.1
Category: Others

How to preload dropdowns in CForm

Created 5 years ago by transistor, updated 5 years ago by transistor.

So you want to use CForm (form builder), but need to preload dropdowns in a form? It's simpler than it seems.
You got your CFormModel, CForm and the actual Form, right?
Let's say you have the typical State -> City dependent dropdowns, so you would want to load the from with the State and City selected.

1 0
2 followers
Viewed: 8 836 times
Version: Unknown (update)
Category: Tips

MySQL migration environment

Created 3 years ago by Fabrizio Caldarelli, updated 3 years ago by Fabrizio Caldarelli.

It can happen that you work in development environment and you make changes to database tables structures, adding tables, or changing fields.

0 0
2 followers
Viewed: 8 858 times
Version: 2.0
Category: How-tos

A simple widget - jump2link

Created 3 years ago by Scott_Huang, updated 3 years ago by Scott_Huang.

namespace app\components;

0 0
1 follower
Viewed: 8 875 times
Version: 2.0
Category: Tutorials

Search a file size range in CGridView

Created 6 years ago by CrazyCat, updated 6 years ago by CrazyCat.
  1. Create an Active Record Behavior that builds the criteria for the search() method and attach it to your model
  2. Modify the search() method of the model to merge the behavior's criteria in with the rest of the searchable attributes
2 0
2 followers
Viewed: 8 930 times
Version: Unknown (update)
Category: Tips

ePay Integration - Bulgarian Payment Provider

Created 6 years ago by yasen, updated 6 years ago by yasen.

} ` V. The Order model would start with:

class Order extends CActiveRecord
{
	const STATUS_INITIATED = 1;
	const STATUS_CANCELED = 2;
	const STATUS_EXPIRED = 3;
	const STATUS_PAID = 4;
	public $statuses = array(
		self::STATUS_INITIATED => 'Initiated',
		self::STATUS_CANCELED => 'Canceled',
		self::STATUS_EXPIRED => 'Expired',
		self::STATUS_PAID => 'Paid',
	);
// more cod...
6 0
5 followers
Viewed: 8 979 times
Version: 1.1
Category: Tutorials

Widget Personalizado

Created 7 years ago by Cálcio, updated 4 years ago by Cálcio.

$this->render('index', array( 'dataProvider' => $dataProvider, )); `

6 0
5 followers
Viewed: 8 983 times
Version: 1.1
Category: Tutorials

Multilanguage Lorem Ipsum Text Generator

Created 6 years ago by yasen, updated 6 years ago by yasen.

Taking futher the idea from Piotr Masełkowski - http://www.yiiframework.com/extension/elipsum/ here's how to generate multilanguage Lorem Ipsum text. This example uses English and Bulgarian sample paragraphs. Create a class in /protected/components/LoremIpsum.php. Wall of text incoming wohoo...

2 0
1 follower
Viewed: 8 990 times
Version: 1.1
Category: How-tos

Getting information from the current locale

Created 11 months ago by CeBe, updated 11 months ago by CeBe.

Yii 2.0 comes with a formatter component to format dates, numbers, and other values for international users according to their locale. This is very useful for displaying data. When working with incoming data or when using enhanced input methods like the [MaskedInput widget](https://www.yiiframework.com/doc/api/2.0/yii-widgets-maskedinp...

5 0
2 followers
Viewed: 9 019 times
Version: 2.0
Category: How-tos

Gettext and Poedit HOWTO

Created 4 years ago by Maug Lee, updated 4 years ago by Maug Lee.

Example settings when using Gettext for i18n.

0 0
2 followers
Viewed: 9 060 times
Version: 1.1
Category: Tutorials

Relation scope to test existence of related records ("EXISTS")

Created 4 years ago by le_top, updated 4 years ago by le_top.

When one needs to select a record in a table that do not have related records through a relation, it is generally suggested to use a subquery. Personnaly, I prefer a high level approach, and I have a method to do it with scopes.

1 0
2 followers
Viewed: 9 067 times
Version: 1.1
Category: How-tos

Caching strategy

Created 5 years ago by darkheir, updated 5 years ago by CeBe.

Note: Before reading this wiki you should have read the caching part in the Yii guide

3 1
12 followers
Viewed: 9 088 times
Version: 1.1
Category: How-tos

an easy way to required multi columns(At least one cannot be blank)

Created 7 years ago by 1065227709, updated 7 years ago by 1065227709.

in model add the following code:

3 0
3 followers
Viewed: 9 122 times
Version: 1.1
Category: Tips
Tags: rules

Yii Rights Management Tips

Created 4 years ago by Rajith R, updated 4 years ago by Rajith R.

yii rights some tips..

2 0
4 followers
Viewed: 9 139 times
Version: 1.1
Category: Tips

Insert data from database to another database table

Created 5 years ago by Kostas Apazidis (KonApaz), updated 5 years ago by Kostas Apazidis (KonApaz).

According to below wiki we could migrate database schema to another database

1 0
2 followers
Viewed: 9 177 times
Version: 1.1
Category: Tutorials
0 0
3 followers
Viewed: 9 200 times
Version: 2.0
Category: How-tos
Tags:

Generate CTreeview from database table and update a model

Created 5 years ago by Kostas Apazidis (KonApaz), updated 5 years ago by Kostas Apazidis (KonApaz).

Suppose we want to set a category to product (or an item in general term), Also suppose categories has sub-categories (multi-level)

1 0
1 follower
Viewed: 9 217 times
Version: 1.1
Category: How-tos

CjuiDatepicker

Created 6 years ago by hiral darji, updated 6 years ago by hiral darji.

If you have two datepicker in one form and you want that a date of from date shold be minimum date of todate then put following code in Cjuidatepicker widget options array:

'onSelect'=>'js:function(selected) {
$("#HostelRoomStatusMaster_room_status_master_end_date").datepicker("option","minDate",selected);
				}',
1 0
5 followers
Viewed: 9 229 times
Version: 1.1
Category: Tips

How to keep filters simple in CGridView

Created 4 years ago by Peppe, updated 4 years ago by le_top.

The problem is not new: after setting some filters in a grid (typically in admin view), and gone to another page, returning in the grid's page I would like to find the filters with previous setting mantained.

0 0
2 followers
Viewed: 9 293 times
Version: 1.1
Category: How-tos