test routing
This commit is contained in:
1 parent
a482a508e4
commit
2f2310e739
6 files changed
+79
-23
No files matched your search
@@ -1,13 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Controllers;
|
||||
namespace app\controllers;
|
||||
|
||||
use Models\Post;
|
||||
|
||||
use app\models\Post;
|
||||
|
||||
class Posts
|
||||
{
|
||||
public static function create_post($post, $user_id)
|
||||
public function actionCreatePost($post, $user_id)
|
||||
{
|
||||
return Post::create(['post'=>$post, 'user_id'=>$user_id]);
|
||||
}
|
||||
|
||||
public function actionViewAllPosts()
|
||||
{
|
||||
foreach (Post::all() as $post)
|
||||
{
|
||||
echo $post->post . "<br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user