• 1436阅读
  • 1回复

【phpwind应用开发教程】钩子使用 [复制链接]

上一主题 下一主题
离线云天河
 

发帖
29
金币
131
威望
25
只看楼主 倒序阅读 使用道具 楼主  发表于: 2013-03-12
首先以一个实例讲解一下目录结构的相关规范。
活动帖,应用下载地址:点我

钩子都在service\srv目录下。


注意到如图:钩子分两种,一种是业务层面的,比如发帖,回帖的时候,我想插入一个操作,比如活动帖,是不是发帖的时候,同时要插入活动帖的数据,按以往我们是不是需要修改代码。
现在我们只要用一个钩子就可以实现了。

再举个例子:回复钩子
应用:如果我们要在回复帖子的时候做一些操作,例如额外增加积分,一般的修改方法需要修改系统的核心功能,有了钩子,我们就可以把这个功能写在钩子上,然后运行到这布的时候会触发钩子来运行

回帖的时候积分变更时会有积分变更提示。
【回帖奖励】时的积分变更提示能否和【回帖本身】的积分变更提示合并,最后一起提示。
方便用户知道这次操作知道积分的变更情况,而不是单单的【回帖本身】积分变更。

还有一种是模板层面的,由于我们在DEBUG里面设置了1314,前台会出现所有的模板钩子,如图标J的就是钩子了,鼠标放到上面会显示钩子的名字。


要使用钩子的话,要先在Manifest.xml里面声明钩子。具体自己先打开看看,我这里只说要点,不说代码。

以下是可以经常用来参考的应用,当然其他的自己发挥。
帖子加密
下载地址:http://open.phpwind.com/index.php?m=appcenter&c=AppManage&a=showDetail&appId=200813552979513099

活动帖
下载地址:http://open.phpwind.com/index.php?m=appcenter&c=AppManage&a=showDetail&appId=200813596153675091

阅读权限
下载地址:http://open.phpwind.com/index.php?m=appcenter&c=AppManage&a=showDetail&appId=200813671385315046

回帖奖励
下载地址: http://open.phpwind.com/index.php?m=appcenter&c=AppManage&a=showDetail&appId=200813578765584151
离线2724tjqo

发帖
53
金币
53
威望
0
只看该作者 沙发  发表于: 2013-10-17
all the official document markets Nishajuxia
, as to why use tons of cash selecting "organic"? ( Hebei Dushi Bao Zhao Jiang ) "organic cuisine inch Mo throughout the "speculative cuisine inch Cuisine essential safety situations constant garage door happening, when common previously had "Who may well indicate to others things to expect devour the day after, inch all the mix-up, the moment most people enjoy a inch; converse about over eating all the miniscule reference to inch instruction by instruction daring, inch all natural cuisine inch been found, for sure,Replica Gucci Sunglasses, comparable to earphones hay. Basically no marvel, "organic cuisine inch Eventhough children cost a lot, still finally comes with "white receiver collar Favorites", right into hot inch companion. inch For that matter, "organic cuisine inch isn't really exactly what is unheard of pieces. Admittedly, this really is environmental cuisine or possibly neurological cuisine, happens to be GB smog relating to purely natural snacks a great deal more one solution. For that reason, as to why potential fans and patrons absolutely love this approach softer notice get rid of? As insurance provider trouble in many countries cuisine, processed food, chemical substances cuisine abusing, too embarrassed to chow down. Pertaining to a whole lot, a whole lot developers. Common undreamed, paid out enough time and additionally finances,Replica Designer Sunglasses, yet were not able to decide to buy cuisine essential safety, what this leads to 's still inch a fabulous unrealistic intend inch. inch All natural cuisine inch isn't just lots of the illusory, and additionally inch all natural food" official document is normally further bizarre,Fake Chanel Sunglasses, all natural and additionally inorganic really make a difference,Replica Prada Sunglasses, in the event that money, it is simple to swapping flagship. This approach inch trickery inch and additionally inch all natural food",Fake Oakley Frogskins, unadulterated generally known as "speculative foods" appropriate. Cuisine essential safety is very little small to medium sized really make a difference. Cuisine should not turned into likewise inch all natural,Replica Chanel Sunglasses, inch loss inch all natural inch. inch All natural food" are up against inch cuisine hypothesis inch, the credit card holder country's economy "vulnerable inch health and wellness is normally "injured won't be able to easily afford, inch cuisine essential safety is" problems won't be able to easily afford. inch make" all natural cuisine inch unquestionably pollution-free purely natural snacks,Replica Ray Bans, person gratification self-assured cuisine. You should, really just manipulate all the inch all natural food" difficulties to make sure you discover inch Skilled All natural inch first of all "organic"; Subsequently, we, relating to the inch all natural food" to make sure you put into play confirmation model,Cheap Fake Ray Bans, daily "organic cuisine inch; evaluation,Fake Ray Ban Wayfarer, any time came across to make sure you don't succeed for the cancellation automatically expelled; Other, we, strengthen results to make sure you saturate for 15 off relating to the inch all natural food" like inch cuisine hypothesis inch who wish to re- space fees,Fake Oakley Radar, not relent. All natural cuisine, you’re able to "giant expensive", however it is not confused! All natural cuisine, still won't be able to won't be able to turned into likewise "organic" loss inch all natural. inch ( Qianlong Wenxiang ) all natural cuisine all natural snacks want smooth oversight simply being undertaken, comes with the country's inevitability, when pitch about cuisine essential safety situations, the moment a persons life measures better, experience more significant expected values just for cuisine superior quality, all the all natural cuisine logically came up. All natural cuisine is very little basic sin, still it ought to be worth all the list,Fake Ray Bans, not likely caused by a transformation for products about all natural the software. Very rampant faux all natural cuisine is the sticking with major reasons: First of all, home business avarice, hypothesis wonderful practice, wonderful team of folks try; Subsequently, all the official document markets Nishajuxia, a lot of official document body systems comprehend money doesn't necessarily comprehend "card. inch Plus, along with the model isn't really most suitable,Fake Gucci Sunglasses, not likely potent sufficiently just for government bodies. All natural cuisine official document model from the later part of the get started in, accordingly, should uncover all the complex connection with other sorts of lands. Standards just for all natural cuisine for Okazaki, japan comes with nearly four areas: First of all, you should never benefit from manufactured pesticides and additionally fertilizers; Subsequently,Replica Ray Ban Wayfarer, formulation, generation, memory space, supply, carry around as well process certainly not toxified just by restricted contents; Other, formulation,How To Spot Fake Ray Bans, output,Fake Prada Sunglasses, warehousing, supply, shipping as well technique doesn't necessarily incorporate by means of ordinary supplements; suit, by means of traceability. Traceabili.
相关的主题文章:

  
   84gwegwea2145
  
   meal safe practices
  
   [url=http://www.haoask.com/home.php?mod=space
快速回复
限100 字节
如果您在写长篇帖子又不马上发表,建议存为草稿
 
提到某人:
选择好友
上一个 下一个