Skip to content

Instantly share code, notes, and snippets.

@lossendae
Forked from splittingred/transport.menu.php
Last active October 3, 2015 08:58
Show Gist options
  • Save lossendae/2431100 to your computer and use it in GitHub Desktop.
Save lossendae/2431100 to your computer and use it in GitHub Desktop.
MODX menu transport file (for MODX 2.3)
<?php
/* will route to the first found of the following:
[namespace-path]controllers/[manager-theme]/index.class.php
[namespace-path]controllers/default/index.class.php
[namespace-path]controllers/index.class.php
*/
$menu= $modx->newObject('modMenu');
$menu->fromArray(array(
'text' => 'mycomponent',
'parent' => 'components',
'description' => 'mycomponent.menu_desc',
'icon' => 'images/icons/plugin.gif',
'menuindex' => 0,
'params' => '',
'handler' => '',
'action' => 'index',
'namespace' => 'mycomponent',
),'',true,true);
return $menu;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment