Fork me on GitHub

Hooks question  Bottom

  • 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?
  • 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
  • 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).
  • 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?

This list is based on users active over the last 60 minutes.