This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// AppController function initialize() | |
$this->Auth->config('authenticate', [ | |
'Form' => [ | |
'userModel' => 'Employees', | |
'finder' => ['auth' => [$this->request->getData()]], | |
'fields' => [ | |
'username' => 'code', | |
'password' => 'encrypted_password', | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class AppModel extends Model { | |
public $actsAs = array( | |
'Search.Searchable', | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class User extends AppModel { | |
public $filterArgs = array( | |
array('name' => 'name', 'type' => 'like', 'field' => 'User.name'), | |
array('name' => 'state', 'type' => 'value', 'field'=>'User.state'), | |
); | |
public $options = array( | |
'default' => array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="users index"> | |
<h2><?php echo __('Users'); ?></h2> | |
<?php echo $this->Form->create(null, array('inputDefaults' => array('label' => false, 'div' => 'controls'))); ?> | |
<?php echo $this->Form->input('name', array('placeholder' => 'name')); ?> | |
<?php echo $this->Chosen->select('state', $states, array('data-placeholder' => 'Pick states...', 'multiple' => true)); ?> | |
<?php echo $this->Form->submit('Search'); ?> | |
<?php echo $this->Form->end(); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class User extends AppModel { | |
public $filterArgs = array( | |
array('name' => 'name', 'type' => 'like', 'field' => 'User.name'), | |
array('name' => 'state', 'type' => 'value', 'field'=>'User.state'), | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class AppModel extends Model { | |
public $actsAs = array( | |
'Search.Searchable', | |
'Collectionable.Options', | |
); | |
public $defaultOption = true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
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'), | |
); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function beforeFilter() { | |
if(isset($this->Ktai) && $this->Ktai->is_ktai()){ | |
$this->layout = 'ktai_default'; | |
$this->viewPath = 'ktai' . DS . $this->viewPath; | |
$this->Ktai->_options = array_merge($this->Ktai->_options, array( | |
'input_encoding' => 'UTF-8', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// in app/Lib/Error/AppExceptionRenderer.php | |
App::uses('ExceptionRenderer', 'Error'); | |
class AppExceptionRenderer extends ExceptionRenderer { | |
protected function _getController($exception) { | |
$controller = parent::_getController($exception); | |
$controller->layout = 'error'; | |
return $controller; | |
} |
NewerOlder