Here is a nice way to bundle your stuff up. I like it because it makes it easy to share methods between controllers and get rid of code duplication.
I namespaced all my custom components so I don't get them confused with a Model name in the future.
$di->setShared('component', function() {
$obj = new stdClass();
$obj->menu = new \Component\Menu();
$obj->helper = new \Component\Helper();
$obj->user = new \Component\User();
return $obj;
});
You can access through:
php$this->component->helper->method(123);
or
php{{ component.helper.method(123) }}