Я использую frontend angularjs и beckend codeignitor (3). Я хочу опубликовать данные в backend-контроллере. Но я не могу получить данные.Как получить данные POST в контроллере codeigniter3
Вот мой html-
<form>
<fieldset class="form-group">
<h3>Get data of your table</h3>
<label for="exampleInputPassword1">Select coloumn value</label>
<input type="text" class="form-control" ng-model="table.table_column" id="exampleInputPassword1" placeholder="table coloumn values">
<small class="text-muted">Please enter valid data.</small>
</fieldset>
<fieldset class="form-group">
<label for="exampleInputEmail1">Enter Table Name</label>
<input type="text" ng-model="table.table_name" class="form-control" id="exampleInputEmail1" placeholder="Enter Table Name">
<small class="text-muted">Please enter valid table name.</small>
</fieldset>
<fieldset class="form-group">
<label for="exampleInputPassword1">Where</label>
<input type="text" class="form-control" ng-model="table.table_where" id="exampleInputPassword1" placeholder="Where">
<small class="text-muted">Please enter valid value</small>
</fieldset>
<fieldset class="form-group">
<label for="exampleInputPassword1">Value</label>
<input type="text" class="form-control" ng-model="table.table_value" id="exampleInputPassword1" placeholder="Table Value">
<small class="text-muted">Please enter valid value</small>
</fieldset>
<button type="submit" class="btn btn-primary" ng-click="submitForm(table)">Submit</button>
</form>
</div>
Вот мой angularjs контроллер функции-
$scope.submitForm = function(table) {
$http.post("http://localhost/DatabaseApp/welcome/getData/",table)
.success(function(response) {$scope.data = response});
}
Вот мой codeignitor функции-
function getData()
{
$table_column = $this->input->post('table_column');
$table_name = $this->input->post('table_name');
$table_value = $this->input->post('table_value');
$table_where = $this->input->post('table_where');
print_r($table_name);
}
Так что, если кто-то может помочь мне Я был бы благодарен. Большое спасибо.
Дайте имена для ввода – praguan