สอบถามเรื่องการเขียนลิงค์ php BB

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

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

putcharaporn_tan
PHP Super Member
PHP Super Member
โพสต์: 394
ลงทะเบียนเมื่อ: 04/08/2015 10:01 am
ติดต่อ:

สอบถามเรื่องการเขียนลิงค์ php BB

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

จะเขียนให้ Extension ลิงค์ไปยังหน้าเว็บเพจอีกหน้าค่ะ

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

<li class="small-icon icon-profile dropdown-container dropdown-right rightside"><a href="{U_***_M_PROFILE}">{L_NAME_TEST}</a></li>
แก้ไขล่าสุดโดย putcharaporn_tan เมื่อ 08/10/2015 6:14 pm, แก้ไขไปแล้ว 1 ครั้ง.
putcharaporn <3
ภาพประจำตัวสมาชิก
thatsawan
PHP VIP Members
PHP VIP Members
โพสต์: 28508
ลงทะเบียนเมื่อ: 31/03/2014 10:02 am
ติดต่อ:

Re: สอบถามเรื่องการเขียนลิงค์

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

U_***_M_PROFILE ==> คืออะไร ค่ะ ขอดูโค้ดหน่อย
putcharaporn_tan
PHP Super Member
PHP Super Member
โพสต์: 394
ลงทะเบียนเมื่อ: 04/08/2015 10:01 am
ติดต่อ:

Re: สอบถามเรื่องการเขียนลิงค์ php BB

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

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

 $this->template->assign_vars(array(
            'U_***_SAMPLE1_PAGE'    => $this->helper->route('M.Profile_controller', array('name' => '***')),
        ));
putcharaporn <3
putcharaporn_tan
PHP Super Member
PHP Super Member
โพสต์: 394
ลงทะเบียนเมื่อ: 04/08/2015 10:01 am
ติดต่อ:

Re: สอบถามเรื่องการเขียนลิงค์ php BB

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

แก้แล้วแต่ยังไม่ขึ้นเลย

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

$this->template->assign_vars(array(
            'U_***_M_PROFILE_PAGE'    => $this->helper->route('***_M_Profile_controller'),
        ));

ในไฟล์ routing.yml
โค๊ตคือ

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

M.Profile_controller:
    pattern: /M_Profile
    defaults: { _controller: XXXX.M_Profile.controller:base}
    requirements:

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

Re: สอบถามเรื่องการเขียนลิงค์ php BB

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

routing.yml
ใช้ชื่อ controller M.Profile_controller oนี้
เวลาเรียกใช้
$this->helper->route('......'), ต้องชื่อเดียวกัน
putcharaporn_tan
PHP Super Member
PHP Super Member
โพสต์: 394
ลงทะเบียนเมื่อ: 04/08/2015 10:01 am
ติดต่อ:

Re: สอบถามเรื่องการเขียนลิงค์ php BB

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

แก้ได้แล้วค่ะพอดีว่าลืม เปิดการใช้งานส่วนของ

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

class main_listener implements EventSubscriberInterface
{
    static public function getSubscribedEvents()
    {
        return array(
           
            'core.page_header'  => 'add_page_header_link',
            'core.user_setup'   => 'load_language_on_setup',
        );
    }
putcharaporn <3
ตอบกลับโพส

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

สมาชิกกำลังดูบอร์ดนี้: Google [Bot] และบุคลทั่วไป 118