Exemplo n.º 1
0
 /**
  * @Route("/get_state/{countryid}", methods={"POST"}, name="get_statetest")
 */
 public function get_stateAction($countryid)
 {
     $state = State::findBycountryid($countryid)->toArray();
     $data = array();
     foreach ($state as $stateitem) {
         $data[] = array('id' => $stateitem['id'], 'state' => $stateitem['state']);
     }
     echo json_encode($data);
 }
Exemplo n.º 2
0
 /**
 * @Route("/get_state/{countryid}", methods={"POST"}, name="get_state")
 */
 public function get_stateAction($countryid)
 {
     $state = State::findBycountryid($countryid)->toArray();
     echo '<select id="stateid" name ="stateid">';
     echo '<option value ="0" >Seleccione un Estado</option>';
     foreach ($state as $stateitem) {
         echo '<option value ="' . $stateitem["id"] . '" >' . $stateitem["state"] . '</option>';
     }
     echo '</select>';
 }
 /**
  * @Route("/get_state_data/{countryid}", methods={"POST"}, name="get_state_data")
  */
 public function get_state_dataAction($countryid)
 {
     $this->view->disable();
     $statedata = State::findBycountryid($countryid)->toArray();
     echo json_encode($statedata);
 }