call a route to load a list of data using js – Jquery
I have a method in the model to search and receive messages public function getAllMessages() { $allMessages = Message::find() ->where(['=', 'phone', $this->phone]) ->all(); return $allMessages; } Then I display all received messages in the view <div class="message-history"> <?php foreach ($messageModel->getAllMessages()…