We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

EE2 Module Control Panel URLs - passing additional segments

Development and Programming

Clicked's avatar
Clicked
19 posts
13 years ago
Clicked's avatar Clicked

Hi,

I am using EE2 (v 2.4) for a site build and am adding my own custom module which will have a series of Control Panel views.

I am using the EE->cp->set_right_nav function to add some navigation links to my Control Panel area, as per this page of the documentation: http://ellislab.com/expressionengine/user-guide/development/cp_styles/index.html#top-right-navigation

$this->EE->cp->set_right_nav(array(
        'updated_sites_create_new' =>
                BASE.AMP.'C=addons_modules'.AMP.'M=show_module_cp'.AMP.'module=updated_sites'.AMP.'method=create')
);

This works great and I am able to use the links to point to different methods in my Module file. However, I would like to pass in additional data in the URL. So let’s say I had a method called ‘foo’:

// within my Module class
public function foo( $bar = 'default bar value')
{
  return $bar;
}

I would like to be able to have two links in my right nav that both point to the foo() method, but which pass in different values for the $bar variable. Something like this:

// Module sub navigation
  $this->EE->cp->set_right_nav(array(
    'My Link 1' => BASE.AMP.'C=addons_modules'.AMP.'M=show_module_cp'.AMP.'module=myModule'.AMP.'method=foo'.AMP.'bar=bar value 1',
    'My Link 2' => BASE.AMP.'C=addons_modules'.AMP.'M=show_module_cp'.AMP.'module=myModule'.AMP.'method=foo'.AMP.'bar=bar value 2',
  ));

This is not working for me at the moment, and I am not able to find anything in the documentation to help me out. I’m sure this is a simple thing to do, but I am really struggling at the moment.

Any help would be appreciated

Charlie

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.