ต้องการจะทำ Path way [phpbb3.1] มันขึ้นว่า "Unable to generate a URL...."

สำหรับผู้ที่ เริ่มต้น Programming - PHP มีอะไร แนะนำ หรือข้อสงสัยต้องบอร์ด นี้ คนที่มีความรู้ แบ่งปันคนอื่นบ้างนะ ปัญหาการเขียนโปรแกรม แบบ OOP Session Cookies php network

Moderator: mindphp, ผู้ดูแลกระดาน

ภาพประจำตัวสมาชิก
thatsawan
PHP VIP Members
PHP VIP Members
โพสต์: 28508
ลงทะเบียนเมื่อ: 31/03/2014 10:02 am
ติดต่อ:

ต้องการจะทำ Path way [phpbb3.1] มันขึ้นว่า "Unable to generate a URL...."

โพสต์ที่ยังไม่ได้อ่าน โดย thatsawan »

Unable to generate a URL for the named route "mindphp_sample1_main" as such route does not exist.

โค้ด: เลือกทั้งหมด

<?php

    namespace mindphp\sample1\controller;

    class main
    {
       public function __construct(\phpbb\config\config $config, \phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, $root_path, $php_ext)
       {
          $this->config = $config;
          $this->template = $template;
          $this->user = $user;
          $this->helper = $helper;
          $this->root_path = $root_path;
          $this->php_ext = $php_ext;
       }
     
       public function base($page = 1)
       {
            //   print_r($this->helper); 
             $this->template->assign_block_vars('navlinks', array(
            'FORUM_NAME'    => $page_title,
            'U_VIEW_FORUM'    => $this->helper->route('mindphp_sample1_main', array('page' => $page)),
//                 $this->helper->route('sample1_controller', array('name' => 'mindphp')
        ));
          return $this->helper->render('sample1_body.html');
       }
    }
?>
ภาพประจำตัวสมาชิก
thatsawan
PHP VIP Members
PHP VIP Members
โพสต์: 28508
ลงทะเบียนเมื่อ: 31/03/2014 10:02 am
ติดต่อ:

Re: ต้องการจะทำ Path way [phpbb3.1] มันขึ้นว่า "Unable to generate a URL...."

โพสต์ที่ยังไม่ได้อ่าน โดย thatsawan »

ทำได้เเย้ว

โค้ด: เลือกทั้งหมด

  $page_title =  $this->user->lang('MINDPHP'); // ดึงข้อความที่จะมาเเสดง
                $this->template->assign_block_vars('navlinks', array(
                            'FORUM_NAME'    => $page_title,
                            'U_VIEW_FORUM'    => $this->helper->route('sample1_controller', array('name' => 'mindphp')), 
// ลิงค์ที่จะคลิก
                    ));
ตอบกลับโพส
  • Similar Topics
    ตอบกลับ
    แสดง
    โพสต์ล่าสุด

ผู้ใช้งานขณะนี้

สมาชิกกำลังดูบอร์ดนี้: ไม่มีสมาชิกใหม่ และบุคลทั่วไป 72