Skip to content

Instantly share code, notes, and snippets.

@emanueljtc
Created November 21, 2016 01:32
Show Gist options
  • Save emanueljtc/dc2029637e28628bcfd218b4ee86bfe2 to your computer and use it in GitHub Desktop.
Save emanueljtc/dc2029637e28628bcfd218b4ee86bfe2 to your computer and use it in GitHub Desktop.
Funcion buscar
public function getPalabraByPersonal() {
if ($this->request->is('ajax')) {
$cedula = $this->params['data']['dni'];
$personal = $this->Personal->find('all',array(
'fields' => array('Personal.idpersonal','Personal.full_name','Personal.cedula'),
'conditions'=>array('Personal.cedula LIKE'=>'%'. $cedula. '%')));
$this->RequestHandler->respondAs('json');
$this->autoRender = false;
echo json_encode ( $personal );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment