ถามตอบ ปัญหาการพัฒนา Extension ไม่ว่าจะเป็น Module plugin Component หรือ แม้แต่ template การปรับแต่งโค้ด Joomla ต่างๆ ทุกเวอร์ชั่น 1.5 2.5 หรือ 3.x
Moderator: mindphp , ผู้ดูแลกระดาน
moomai
PHP Super Hero Member
โพสต์: 680 ลงทะเบียนเมื่อ: 07/12/2016 10:54 am
โพสต์ที่ยังไม่ได้อ่าน
โดย moomai » 08/05/2017 11:50 am
สอบถามค่ะ สร้าง Module Joomla แล้วไม่ขึ้นให้ติดตั้ง ไม่ทราบว่าผิดตรงไหนต้องแก้ไขยังไงค่ะ
สร้าง Module ตามโครงสร้าง จากที่นี่
https://www.mindphp.com/forums/viewtopic ... 42&t=28028
โครงสร้าง
โค้ด: เลือกทั้งหมด
mod_claim
-mod_claim.php
-mod_claim.xml
-helper.php
-teml
--default.php
--index.html
ไฟล์ mod_claim.php
โค้ด: เลือกทั้งหมด
defined('_JEXEC') or die;
require_once dirname(__FILE__) . '/helper.php';
$claim = modClaimHelper::getHello($params);
require JModuleHelper::getLayoutPath('mod_claim');
ไฟล์ mod_claim.xml
โค้ด: เลือกทั้งหมด
<?xml version="1.0" encoding="utf-8"?>
<extension type="module" version="3.1.0" client="site" method="upgrade">
<name>MyProject, Claim</name>
<author>John Doe</author>
<version>1.0.0</version>
<description>A simple MyProject, Claim module.</description>
<files>
<filename>mod_claim.xml</filename>
<filename module="mod_claim">mod_claim.php</filename>
<filename>index.html</filename>
<filename>helper.php</filename>
<filename>tmpl/default.php</filename>
<filename>tmpl/index.html</filename>
</files>
<config>
</config>
</extension>
ไฟล์ helper.php
โค้ด: เลือกทั้งหมด
class ModClaimHelper
{
public static function getHello($params)
{
return 'MyProject, Claim';
}
}
ไฟล์ default.php
ไฟล์ index.html
โค้ด: เลือกทั้งหมด
<html>
<body bgcolor="#FFFFFF"></body>
</html>
The truth is not as elegant as the idea .
tsukasaz
PHP VIP Members
โพสต์: 21909 ลงทะเบียนเมื่อ: 18/04/2012 9:39 am
โพสต์ที่ยังไม่ได้อ่าน
โดย tsukasaz » 08/05/2017 11:58 am
ไม่ขึ้นให้ติดตั้งคือยังไงครับ
ลองใช้ 2 วิธี
1. ทำเป็นไฟล์ zip แล้วเอาไปติดตั้งผ่านหน้าติดตั้งของมัน ถ้ามี error ก็เอา error มาดู
2. ใช้ discover ลอง clear cache แล้วกด discover ถ้ามี error ก็เอา error มาดู
The last bug isn't fixed until the last user is dead. (Sidney Markowitz, 1995 )
moomai
PHP Super Hero Member
โพสต์: 680 ลงทะเบียนเมื่อ: 07/12/2016 10:54 am
โพสต์ที่ยังไม่ได้อ่าน
โดย moomai » 08/05/2017 2:23 pm
ลองติดตั้งทั้งสองวิธีแล้ว
1. ทำเป็นไฟล์ zip แล้วเอาไปติดตั้งผ่านหน้าติดตั้งของมัน
error ที่ขึ้น
Error
Error installing module
โค้ด: เลือกทั้งหมด
JInstaller: :Install: File does not exist D:\xampp\htdocs\project_claim\tmp\install_59101108652d4\mod_mdclaim\index.html
Module %s: Could not copy files from the source.
2. ใช้ discover ลอง clear cache แล้วกด discover
The truth is not as elegant as the idea .
tsukasaz
PHP VIP Members
โพสต์: 21909 ลงทะเบียนเมื่อ: 18/04/2012 9:39 am
โพสต์ที่ยังไม่ได้อ่าน
โดย tsukasaz » 08/05/2017 2:37 pm
Error ตอน install มันบอกว่าไฟล์ index.html ไม่มี
The last bug isn't fixed until the last user is dead. (Sidney Markowitz, 1995 )
moomai
PHP Super Hero Member
โพสต์: 680 ลงทะเบียนเมื่อ: 07/12/2016 10:54 am
โพสต์ที่ยังไม่ได้อ่าน
โดย moomai » 08/05/2017 2:54 pm
มีนะคะไฟล์ที่ ZIP ไปติดตั้ง
Capture.PNG (66.22 KiB) Viewed 697 times
โค้ดในไฟล์
โค้ด: เลือกทั้งหมด
<html>
<body bgcolor="#FFFFFF"></body>
</html>
The truth is not as elegant as the idea .
tsukasaz
PHP VIP Members
โพสต์: 21909 ลงทะเบียนเมื่อ: 18/04/2012 9:39 am
โพสต์ที่ยังไม่ได้อ่าน
โดย tsukasaz » 08/05/2017 3:15 pm
เทียบกับไฟล์ใน xml ด้วยครับ ต้องตรงกัน
The last bug isn't fixed until the last user is dead. (Sidney Markowitz, 1995 )
moomai
PHP Super Hero Member
โพสต์: 680 ลงทะเบียนเมื่อ: 07/12/2016 10:54 am
โพสต์ที่ยังไม่ได้อ่าน
โดย moomai » 08/05/2017 4:27 pm
ต้องเทียบยังไงคะ
moomai เขียน:
ไฟล์ mod_claim.xml
โค้ด: เลือกทั้งหมด
<?xml version="1.0" encoding="utf-8"?>
<extension type="module" version="3.1.0" client="site" method="upgrade">
<name>MyProject, Claim</name>
<author>John Doe</author>
<version>1.0.0</version>
<description>A simple MyProject, Claim module.</description>
<files>
<filename>mod_claim.xml</filename>
<filename module="mod_claim">mod_claim.php</filename>
<filename>index.html</filename>
<filename>helper.php</filename>
<filename>tmpl/default.php</filename>
<filename>tmpl/index.html</filename>
</files>
<config>
</config>
</extension>
The truth is not as elegant as the idea .
0 ตอบกลับ
1956 แสดง
โพสต์ล่าสุด โดย Patipat
11/07/2019 2:43 pm
2 ตอบกลับ
1853 แสดง
โพสต์ล่าสุด โดย Semon
04/03/2019 7:03 pm
4 ตอบกลับ
3046 แสดง
โพสต์ล่าสุด โดย jay_limm
17/06/2014 10:58 pm
0 ตอบกลับ
99 แสดง
โพสต์ล่าสุด โดย adinan49
07/12/2021 9:18 pm
สมาชิกกำลังดูบอร์ดนี้: ไม่มีสมาชิกใหม่ และบุคลทั่วไป 41