From 1f9024763d9224c4cd9a181bac27e6b9f12ad672 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Wed, 18 Sep 2024 14:14:53 -0400 Subject: refactor --- src/web/_controller/_comments.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/web/_controller/_comments.php') diff --git a/src/web/_controller/_comments.php b/src/web/_controller/_comments.php index 059b926..eea792f 100644 --- a/src/web/_controller/_comments.php +++ b/src/web/_controller/_comments.php @@ -3,12 +3,10 @@ class _comments_controller extends Controller { private $comments_model; - function __construct($load) { - parent::__construct($load); - $this->comments_model = $this->load->model('_comments'); + function __construct() { + $this->comments_model = $this->load_model('_comments'); } - public function comments(string $page, string $ref): void { $data = $this->comments_model->get_comments($page); $this->view('comments', array( @@ -79,7 +77,7 @@ class _comments_controller extends Controller { ->post_comment($author, $content, $page, $vulgar); if ($result) { - header('Location: ' . $this->main->get_url($ref) . '#comments'); + header('Location: ' . $this->get_url($ref) . '#comments'); } else { $this->error(500); } -- cgit v1.2.3-freya