view->fields = $field; } public function resetAction() { $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(); $fields = new Scores_Fields(); $fields->resetFamille('juridique'); } public function completedAction() { $table = new Application_Model_FormeJuridique(); $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(); $request = $this->getRequest(); $q = strtolower($request->getParam('q')); $separator = ' , '; $sql = $table->select() ->where('LOWER(fjLibelle) LIKE "%'.$q.'%"') ->where('LENGTH(fjCode) = 4'); $result = $table->fetchAll($sql); foreach ($result as $item) { $output[] = array( 'label' => $item->fjLibelle . $separator . $item->fjCode, 'value' => $item->fjCode ); } echo json_encode($output); } }