$newItems = array();
$_newItems = array(
array(
'name' => Yii::t('app', 'Profile Settings'),
'icon' => 'glyphicon-user',
'active' => 'api_keys',
'route' => null,
'items'=>array(
array(
'name' => Yii::t('app', 'Blog'),
'icon' => 'glyphicon-pencil',
'active' => 'api_keys',
'route' => 'https://website.com/blog',
'active' => false,
),
array(
'name' => Yii::t('app', 'Events'),
'icon' => 'glyphicon-calendar',
'active' => 'api_keys',
'route' => 'https://website.com/event',
'active' => strpos($route, 'https://website.com/event') === 0,
)
),
),
.......
// taken from:/apps/backend/components/web/widgets/LeftSideNavigationWidget.php
...
'monetization' => array(
'name' => Yii::t('app', 'Monetization'),
'icon' => 'glyphicon-credit-card',
'active' => array('payment_gateway', 'price_plans', 'orders', 'promo_codes', 'currencies', 'taxes'),
'route' => null,
'items' => array(
array('url' => array('payment_gateways/index'), 'label' => Yii::t('app', 'Payment gateways'), 'active' => strpos($route, 'payment_gateway') === 0),
array('url' => array('price_plans/index'), 'label' => Yii::t('app', 'Price plans'), 'active' => strpos($route, 'price_plans') === 0),
array('url' => array('orders/index'), 'label' => Yii::t('app', 'Orders'), 'active' => strpos($route, 'orders') === 0),
array('url' => array('promo_codes/index'), 'label' => Yii::t('app', 'Promo codes'), 'active' => strpos($route, 'promo_codes') === 0),
array('url' => array('currencies/index'), 'label' => Yii::t('app', 'Currencies'), 'active' => strpos($route, 'currencies') === 0),
array('url' => array('taxes/index'), 'label' => Yii::t('app', 'Taxes'), 'active' => strpos($route, 'taxes') === 0),
),
),
...
Don't do that. Register a controller and then add a menu item pointing to the registered controller. Have a look at the support tickets extension or backup manager extension to see how they register routes in menus.I can create a menu item pointing a php file in the same directory of the extension ?
PHP:
Code:public function run() { Yii::app()->hooks->addFilter('customer_left_navigation_menu_items', array($this, '_removeMenuItem'), 100); }
Hi, is this still relevant? I added this as you described but the link is in the middle of the left menu list still. Thanks by the way, at least I have a link there now.
public function run()
{
Yii::app()->hooks->addFilter('customer_left_navigation_menu_items', array($this, '_addMenuItem'), 100);
}