2021-06-02 11:27:13 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require "../../bootstrap.php";
|
|
|
|
|
|
|
|
use Backend\Model\Post;
|
|
|
|
|
2021-06-08 12:08:24 +00:00
|
|
|
if(isset($_POST['id'])){
|
2021-06-03 10:50:28 +00:00
|
|
|
$post = Post::query()->find($_POST['id']);
|
|
|
|
$post->title = $_POST['upTitle'];
|
|
|
|
$post->description = $_POST['upDescription'];
|
2021-06-02 11:27:13 +00:00
|
|
|
|
2021-06-08 12:08:24 +00:00
|
|
|
if($post->update()){
|
|
|
|
return 1;
|
2021-06-02 11:27:13 +00:00
|
|
|
}
|
|
|
|
}
|