Skip to content

Instantly share code, notes, and snippets.

@konnoyosuke
Created December 19, 2012 07:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save konnoyosuke/4335030 to your computer and use it in GitHub Desktop.
Save konnoyosuke/4335030 to your computer and use it in GitHub Desktop.
<?php
App::uses('AppController', 'Controller');
class UsersController extends AppController {
public $components = array('Search.Prg');
public $presetVars = array(
array('model' => 'User', 'field' => 'name', 'type' => 'value'),
array('model' => 'User', 'field' => 'state', 'type' => 'value'),
array('model' => 'User', 'field' => 'tel', 'type' => 'value'),
);
function index() {
$this->Prg->commonProcess();
$this->paginate = Set::Merge($this->User->options(), array('conditions' => array($this->User->parseCriteria($this->passedArgs))));
$this->set('users', $this->paginate());
$states = Classregistry::init('State')->find('list', array('fields' => array('state', 'state')));
$this->set(compact('states'));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment