Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Prepare form and add my field.
- *
- * @param JForm $form The form to be altered.
- * @param mixed $data The associated data for the form.
- *
- * @return boolean
- *
- * @since 0.0.1
- */
- function onContentPrepareForm($form, $data)
- {
- $app = JFactory::getApplication();
- $menu = $app->getMenu();
- $pid = $data->parent_id;
- $parent = $menu->getItem($pid);
- var_dump($data->parent_id);
- // returns the parent_id string of the currently edited menu item
- var_dump($parent);
- // returns null
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement