2

Twig テンプレートを介した情報の表示に問題があります。

を使用してTwig TemplateAltoRouterます。

AltoRouter コード:

 $router->map('GET','/[*]','Edion\Controllers\QuestionController@showCountMessage'
             ,'count_message');

コントローラ:

 public function showCountMessage() {
    $message = InsideMessage::where('author_id', '=', $_SESSION['user']['id'])
               ->where('author_read', '=', '0')->get();
    echo $this->twig->render('topnav.html.twig', ['messages' => count($message)]);
 }

topnav.html.twig are included in all my pages

問題は、自分の Web サイトでメッセージの数を取得できないことです。AltoRouter コードを変更した場合:

   $router->map('GET','/example','Edion\Controllers\QuestionController@showCountMessage'
               ,'count_message');

そして、私はsitename.com/exampleそれが完全に機能すると入力しましたが[*]、この情報をすべてのページに表示したいので変更すると、機能しません。

多分誰かがこの問題を解決する方法を知っていますか?

4

1 に答える 1