Skip to content

Instantly share code, notes, and snippets.

@BobRay
Created April 20, 2012 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save BobRay/2430933 to your computer and use it in GitHub Desktop.
Save BobRay/2430933 to your computer and use it in GitHub Desktop.
MODX menu transport file
$action= $modx->newObject('modAction');
$action->fromArray(array(
'id' => 1,
'namespace' => 'mycomponent',
'parent' => 0,
'controller' => 'index',
'haslayout' => true,
'lang_topics' => 'mycomponent.:default,lexicon',
'assets' => '',
),'',true,true);
/* load action into menu */
$menu= $modx->newObject('modMenu');
$menu->fromArray(array(
'text' => 'mycomponent',
'parent' => 'components',
'description' => 'mycomponent.menu_desc',
'icon' => 'images/icons/plugin.gif',
'menuindex' => 0,
'params' => '',
'handler' => '',
),'',true,true);
$menu->addOne($action);
return $menu;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment