2023-06-03 20757

首頁 » 文檔 » 開發(fā)指南

模塊開發(fā)流程

一、復(fù)制模塊

首先根據(jù)需要制作的模塊功能,從系統(tǒng)已有模塊里選擇一個功能類似的模塊,在此模塊基礎(chǔ)上進(jìn)行修改開發(fā)
例如,復(fù)制求購模塊為采購,模塊為offer
復(fù)制 module/buy/ 為 module/offer
修改 module/offer/buy.class.php 為 module/offer/offer.class.php

復(fù)制 template/default/buy/ 為 template/default/offer/
復(fù)制 template/default/member/my_buy.htm 為 template/default/member/my_offer.htm
復(fù)制 template/default/tag/list-buy.htm 為 template/default/tag/list-offer.htm
復(fù)制 template/default/homepage/buy.htm 為 template/default/homepage/offer.htm

復(fù)制 template/mobile/buy/ 為 template/mobile/offer/
復(fù)制 template/mobile/member/my_buy.htm 為 template/mobile/member/my_offer.htm
復(fù)制 template/mobile/tag/list-buy.htm 為 template/mobile/tag/list-offer.htm
復(fù)制 template/mobile/homepage/buy.htm 為 template/mobile/homepage/offer.htm

復(fù)制 skin/default/buy.css 為 skin/default/offer.css
復(fù)制 lang/zh-cn/buy.inc.php 為 lang/zh-cn/offer.inc.php
復(fù)制 company/buy/ 為 company/offer/
復(fù)制 module/company/buy.inc.php 為 module/company/offer.inc.php
復(fù)制 file/setting/buy.csv 為 file/setting/offer.csv
復(fù)制 file/setting/buy.sql 為 file/setting/offer.sql

所有新創(chuàng)建的文件,在文件內(nèi)容里查找buy,批量替換為offer,查找求購,批量替換為采購

在后臺模塊管理,添加模塊
模塊名稱 采購
所屬模型 采購
安裝目錄 offer
提交

假如提交之后,采購的模塊ID為26
修改 module/offer/admin/install.inc.php 里面的6為26
復(fù)制 file/cache/module-6.php 為 file/cache/module-26.php
進(jìn)入后臺功能模塊,采購管理,模塊設(shè)置,提交一下設(shè)置
然后復(fù)制file/cache/module-26.php 到 file/setting/module-26.php

二、設(shè)計字段

根據(jù)實際需要新增字段和刪除無用字段
后臺模板module/offer/admin/tenplate/edit.tpl.php
前臺模板template/default/member/my_offer.htm
字段驗證和寫入module/offer/offer.class.php
增加或刪除的字段需要同時在destoon_offer_26數(shù)據(jù)表里操作

三、編寫邏輯

以下為所有采購模塊相關(guān)的文件的作用列表,根據(jù)實際情況修改對應(yīng)文件(其他模塊通用)
文件路徑 功能
module/offer/admin/index.inc.php 后臺采購列表
module/offer/admin/template/index.tpl.php 后臺采購列表模板
module/offer/admin/template/edit.tpl.php 后臺添加和修改信息模板
module/offer/admin/html.inc.php 后臺更新網(wǎng)頁
module/offer/admin/template/index.tpl.php 后臺更新網(wǎng)頁模板
module/offer/admin/setting.inc.php 后臺模塊設(shè)置
module/offer/admin/template/setting.tpl.php 后臺模塊設(shè)置模板,此模板可以直接增加或刪除參數(shù)
module/offer/admin/config.inc.php 后臺模塊相關(guān)的配置
module/offer/admin/menu.inc.php 后臺模塊左側(cè)菜單
module/offer/admin/install.inc.php 后臺安裝模塊需要執(zhí)行的操作
module/offer/admin/uninstall.inc.php 后臺安裝模塊需要執(zhí)行的操作
module/offer/admin/remkdir.inc.php 后臺重建模塊目錄需要執(zhí)行的操作
module/offer/offer.class.php 核心類庫,所有的數(shù)據(jù)操作通過此文件實現(xiàn)
module/offer/common.inc.php 通用文件,模塊所有文件都先包含此文件
module/offer/global.func.php 模塊需要用到的函數(shù)
module/offer/index.inc.php 前臺首頁
module/offer/index.htm.php 前臺生成靜態(tài)首頁
module/offer/list.inc.php 前臺列表
module/offer/list.htm.php 前臺生成靜態(tài)列表
module/offer/show.inc.php 前臺內(nèi)容頁
module/offer/list.htm.php 前臺生成靜態(tài)內(nèi)容頁
module/offer/search.inc.php 前臺搜索頁
module/offer/my.inc.php 會員中心會員管理和發(fā)布采購頁
module/offer/task.inc.php 前臺任務(wù)頁
module/offer/price.inc.php 前臺報價頁
module/company/offer.inc.php 公司主頁采購頁
template/default/offer/index.htm 前臺首頁模板
template/default/offer/list.htm 前臺列表模板
template/default/offer/show.htm 前臺內(nèi)容模板
template/default/offer/search.htm 前臺搜索模板
template/default/offer/price.htm 前臺報價模板
template/default/tag/list-offer.htm 前臺標(biāo)簽?zāi)0?/td>
template/default/member/my_offer.htm 會員中心會員管理和發(fā)布采購模板
template/default/homepage/offer.htm 公司主頁采購模板
template/mobile/offer/ 手機(jī)版采購模板
skin/default/offer.css 采購模塊前臺樣式
lang/zh-cn/offer.inc.php 采購模塊語言文件
模塊 模塊開發(fā) 開發(fā) 二次開發(fā)
以上內(nèi)容是否對您有幫助?點擊反饋加群交流

 
公司簡介   |   聯(lián)系方式   |   合作代理   |   隱私政策   |   使用協(xié)議   |   意見反饋