ajjm2284
unread,Feb 3, 2013, 12:25:09 PM2/3/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to zend-framew...@googlegroups.com
Estimados su ayuda, llevo dandole vueltas como 2 dias, y no funciona un getter y un setter, no se que estoy haciendo mal, mas abajo pongo el codigo.
private $codper;
public function getCodper(){
return $this->codper;
}
public function setCodper($codper) {
$this->codper = $codper;
}
public function buscarpercedAction()
{
$cedula = $this->getRequest()->getParam('cedula');
$personaModel = new Siscp_Model_Table_Personal( );
$data = $personaModel->getPersonaxCed($cedula);
foreach ($data as $item)
$this->setCodper($item['per_id']); //Seteo el valor
$data1 = new Zend_Dojo_Data ('per_id', $data);
if(count($data1) > 0){
$json = new Zend_Json ( );
echo $json->encode ($data1);
}else{
$data1->clearItems();
$json = new Zend_Json ( );
echo $json->encode ($data1);
}
exit();
}
public function jqgdatosAction()
{
// get the requested page
$page = $this->getRequest()->getParam('page');
// get how many rows we want to have into the grid - rowNum parameter in the grid
$limit = $this->getRequest()->getParam('rows');
// get index row - i.e. user click to sort. At first time sortname parameter -
// after that the index from colModel
$sidx = $this->getRequest()->getParam('sidx');
// sorting order - at first time sortorder
$sord = $this->getRequest()->getParam('sord');
// if we not pass at first time index use the first column for the index or what you want
$id = $this->getCodper(); //Quiero obtener el valor que guarde en la variable y obtengo un 0
}