Why dont you create a helper object or a widget submenu or … there are tones of solutions better than accessing a controller. Stick with MVC pattern my friend, it is a recommendation and let controllers to do what they best do
Then I recommend you to create a widget. Here is an example (and one extension widget ) to look at or implement in your project :http://www.yiiframework.com/extension/menu
I am trying to place the code for the subMenu items in one place then use it in a couple. I have set up a website that the default page lists these options in the $content area. I would also like to have them available in a dropdown of the main menu. So I thought that placing them in the controller was the best place.
When you say create a “helper” what do you mean/how? I am really new to MVC and don’t understand some of it’s concepts…Where to put what, etc…
If you want to place someware some code that you will use in more than one place, don’t place in controller, controller are meant to be as thin as possible.
Create a component for this: the easiest way is to add a file SubMenu.php in component and implement a static function.
If you want to do something more complex, with some possibility of configuration, follow the link of Antonio and create a widget.