[eluser]codex[/eluser]
Hey wire, ME is looking better and better, but there's (hopefully
) one last thing I'm not certain about.
I'm making use of the _remap function:
Code:
function _remap($page)
{
$method = $this->uri->rsegment(3);
$value = $this->uri->rsegment(4);
if($this->uri->total_segments() == 0)
{
$data['module'] = modules::run('public/pages/pages','', 'index');
}
elseif($this->uri->total_segments() > 0)
{
switch($page)
{
case 'blog':
$data['module'] = modules::run('public/blog/blog', $this->uri->segment(1), 'index');
break;
case 'portfolio':
$data['module'] = modules::run('public/portfolio/portfolio', $value, 'listPortfolioItems');
break;
default:
$data['module'] = modules::run('public/pages/pages', $this->uri->segment(1), 'show_page');
}
}
If you look at the second case, it means that "if you encounter portfolio as the pagename, send the request to the portfolio module. When you're in the portfolio module, go to the listPortfolioItems method", right?
The corresponding URL would be
Code:
http://www.domain.com/portfolio/
But what if you have a value after /portfolio/?
Code:
http://www.domain.com/portfolio/some_portfolio_name_here
How do you 'tell' _remap() which method to use then?
I hope you don't mind me asking you a lot of questions ;-)