I meant something like form for desired entity's name, fields, views integration options, maybe tie it to particular schema, mundane things like that, to minimize hand-filling functions and callbacks. But I guess it might be bit complicatedo to write it. Maybe someone with the idea would be able to.
The simpler thing would be to add a template to the hooks.template file, and in that use variable replacement to generate some standard-ish callback names.
For example, this is what hook_menu() does:
$items['%module/admin'] = array(
'title' => 'TODO: Enter menu item title',
'page callback' => 'drupal_get_form',
'page arguments' => array('%module_form'),
'access arguments' => array('TODO: Enter user permissions'),
);
Well let it stay open for now. I guess when I'll get a better grasp on entities than I have now, I can give it a try. Or maybe someone will do it sooner. Either way, if it's at least partially doable, it's worth to remember.
Comments
Comment #1
joachim commentedCan you explain more about what you want?
The only hooks you need to define an entity are entity_info and schema. Callbacks too, but those are not yet available in api.php files.
Comment #2
Mołot commentedI meant something like form for desired entity's name, fields, views integration options, maybe tie it to particular schema, mundane things like that, to minimize hand-filling functions and callbacks. But I guess it might be bit complicatedo to write it. Maybe someone with the idea would be able to.
Comment #3
joachim commentedThe simpler thing would be to add a template to the hooks.template file, and in that use variable replacement to generate some standard-ish callback names.
For example, this is what hook_menu() does:
Comment #4
Mołot commentedWell let it stay open for now. I guess when I'll get a better grasp on entities than I have now, I can give it a try. Or maybe someone will do it sooner. Either way, if it's at least partially doable, it's worth to remember.
Comment #5
joachim commentedSee #2046903: 'functionality' based components.