fix vendor
This commit is contained in:
24
app/controllers/PostController.php
Normal file
24
app/controllers/PostController.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace app\controllers;
|
||||
|
||||
|
||||
use app\helpers\Debug;
|
||||
use app\models\Post;
|
||||
|
||||
class PostController
|
||||
{
|
||||
public function actionCreatePost($post, $user_id)
|
||||
{
|
||||
return Post::create(['post'=>$post, 'user_id'=>$user_id]);
|
||||
}
|
||||
|
||||
public function actionIndex(): void
|
||||
{
|
||||
Debug::dd("Post list");
|
||||
foreach (Post::all() as $post)
|
||||
{
|
||||
echo $post->post . "<br>";
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user