v0.0.8 Ajax now works with backend
This commit is contained in:
@@ -4,19 +4,17 @@ require "../../bootstrap.php";
|
||||
|
||||
use Backend\Model\Post;
|
||||
|
||||
//Chek if the user did press the button on the home pages
|
||||
if(isset($_POST['createPost'])){
|
||||
//Create a new initialize
|
||||
$post = new Post();
|
||||
//Create a new initialize
|
||||
$post = new Post();
|
||||
|
||||
//Get the data from post and save it to the post model
|
||||
$post->title = $_POST['title'];
|
||||
$post->description = $_POST['description'];
|
||||
//Get the data from post and save it to the post model
|
||||
$post->title = $_POST['title'];
|
||||
$post->description = $_POST['description'];
|
||||
|
||||
//Call the save function.
|
||||
if(!$post->save()){
|
||||
return http_response_code(400);
|
||||
}else{
|
||||
return http_response_code(200);
|
||||
}
|
||||
//Call the save function.
|
||||
if(!$post->save()){
|
||||
return http_response_code(400);
|
||||
}else{
|
||||
return http_response_code(200);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user