What is the difference between an "Item Create Hook (API)" and an "Item New Hook (GUI)" ??
What is the difference between an "Item Update Hook (API)" and an "Item Modify Hook (GUI)" ??
except for the blatantly obvious - API v. GUI....
do they both accomplish the same thing, but either through the API or through the template? Is there a situation where a mod dev would use both?
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- rgasch created topic »Using PageUtil::addVar() to load script code« 11:48 AM
- michiel responded to »password problem« 10:01 AM
- mazdev responded to »Hide "Register new account" and change template to 3 col« 07:50 AM
- mesteele101 created topic »Zikula 1.3.3 - Site Search 1.5.2 - Unable to turn off plug-ins« 07:48 AM
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Hooks question
-
- Rank: Developer
- Registered: Jun 16, 2003
- Last visit: May 29, 2010
- Posts: 1966
-
- Rank: Team Member
- Registered: Jan 19, 2003
- Last visit: Apr 06, 2010
- Posts: 442
New and Modify hooks are something like "display hooks for edit pages". For example crpTag use them to display the tagging subform within a form to create/edit a news article. Thus they are GUI hooks, as they potentially contribute to the output.
Create and Update hooks are on API level, as they perform corresponding create and update operations. For example MediaAttach use them to store given uploads for an object (there is a ticket to support new and modify hooks in MA as well).
HTH,
Axel
--
Guite | ModuleStudio -
- Rank: Team Member
- Registered: Sep 05, 2006
- Last visit: May 06, 2010
- Posts: 78
That's what I think, but could be wrong.
Item New Hook (GUI)
User interface of the hook to register a new item (templates)
Item Create Hook (API)
PHP code that register the new item into the DB, files, ...
Item New Hook (GUI) should call the Item Create Hook (API) to register the infos set by the user.
Is there a situation where a mod dev would use both?
If what I said above is correct, don't use both of them, only one of them. If you don't want to make your own interface you use Item New Hook (GUI) either you use Item Create Hook (API). -
- Rank: Developer
- Registered: Jun 16, 2003
- Last visit: May 29, 2010
- Posts: 1966
Quote
New and Modify hooks are something like "display hooks for edit pages".
so appropriately registered hooks add some kind of subform to my new/edit form ? How does the information get processed? (Item-create-hook?) So, if this is the case, then both are needed?
- Moderated by:
- Support
