Closed (duplicate)
Project:
Drupal core
Version:
7.x-dev
Component:
documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
6 Jan 2007 at 01:50 UTC
Updated:
1 Jun 2009 at 20:32 UTC
Jump to comment: Most recent file
Comments
Comment #1
webchickHm. Problem is, this will still show up as "hook" documentation. I wonder if we want a separate area to describe functors... $form_id .'_validate' and such qualify as well, and it would be nice to get those documented too.
Comment #2
pwolanin commentedI don't think the form callbacks are ever termed "hooks", are they?
Also, they are still hooks. The suggestion was really just using a different name placeholder to distinguish them from the usual module hooks new developers.
My only other suggestion instead of "functor" would be "nook" = "node hook"
Comment #3
webchickHaha, -1 to nook. ;)
Hm. When I was in IRC, I understood the definition of "functor" (the way Drupal's using it) to be "a callback function where the prefix is known and the suffix is one of a select list." So it seems like FAPI callbacks would fall into that too. Not sure though.
chx???? :P
Comment #4
pwolanin commentedAre you sure you don't like nook?
Comment #5
pwolanin commentedslighly better wording, again using "functor"
Comment #6
pwolanin commentedAlso, where is the wording at the top of this page defined: http://api.drupal.org/api/HEAD/group/hooks
There is a typo, and also this will need to be updated to explain functor_ as much or more than the intro to node.php.
Comment #7
chx commentedLarry Garfield suggested method instead of hook: method_load, method_view etc. I like that much bet
Comment #8
pwolanin commentedWorks for me- method is certainly easier to understand than functor...
patch attached
Comment #9
killes@www.drop.org commentedI don't think this makes any sense and disapprove of such a change.
Comment #10
pwolanin commentedhow about this patch- it uses the placeholder "typehook_", and adds some other clarifications, but the term "hook" is still used to describe the functions. It makes these functions a little different, but doesn't stray as far from the "hook_" convention.
(If only hook_node_info() used something like "typehook" or "type_hook" instead of "module", I think that would also add greatly to clarifying how this works. )
Comment #11
RobRoy commentedI think this may cause more confusion than it is really worth. I agree with killes and walkah; I like the simplicity that new developers know you can always do hook_ -> modulename_ and be okay. If we have hook_ and method_ it will just add another layer, albeit small, to that learning process, but if everyone agrees that it truly would make things clearer then I'm okay with it.
Comment #12
walkah commented-1 . I don't think there's any need for this , and it adds confusion. "method_" doesn't add anything descriptive (any more than our invented "hook"), and documentation lookups will require knowledge of which is intended.
Comment #13
pwolanin commentedhow about "typehook_" per the last patch?
Comment #14
RobRoy commentedIMO it should remain hook_ as per the points above. -1
Comment #15
Gary Feldman commentedHow about leaving it as hook, but adding a section The Two Types of Hooks?
Comment #16
dokumori commentedChanged the component to reflect the new component categorization. See http://drupal.org/node/301443
-dokumori
Comment #17
emmajane commented"the HEAD developer docs" should be in API documentation
Comment #18
pwolanin commentedThe "Documentation" corresponds to my commits to the docs in CVS, so I think that's the right project.
http://drupal.org/project/cvs/18753
Comment #19
MGParisi commentedCan I get a Review? Fixed?
Comment #20
jhodgdonThe Documentation project refers to Handbook pages on drupal.org. Project Drupal, component Documentation, refers to doc that ends up on api.drupal.org.
Comment #21
catchMarking duplicate of #441148: Improve node API's developer experience.