22 lines
498 B
PHP
22 lines
498 B
PHP
|
|
<?php
|
||
|
|
/**
|
||
|
|
* CountriesController controls the actions for countries
|
||
|
|
*/
|
||
|
|
class CountriesController{
|
||
|
|
private $model;
|
||
|
|
|
||
|
|
function __construct(){
|
||
|
|
$this->model = new CountriesModel();
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* returns json response for countries
|
||
|
|
* @return list all countries json
|
||
|
|
*/
|
||
|
|
public function getAllCountries(){
|
||
|
|
$getArray = isset($_REQUEST['getArray']) ? $_REQUEST['getArray'] : false;
|
||
|
|
echo json_encode($this->model->getAllCountries($getArray));
|
||
|
|
}
|
||
|
|
}
|
||
|
|
?>
|