[eluser]stormbytes[/eluser]
This has got me baffled.
Below is the code from my Asset controller.
Very simple. If the $asset_id arg is not specified (eg. someone manually altered a link or URL/address) then redirect to "Catalog" -
Else..
Load the specified View.
Now here's the funny business:
If I were to manually type base-url.com/asset/ then it would redirect me to 'catalog', as it should - so evidently the index (default) method seems to be working!
But if I type ANY argument following that string (eg. base-url.com/asset/234) it returns 404-page not found!?
I've been hammering my head against this thing for 2 hours now. Either it works, or it doesn't!? What's this 'part-time' working business
Caveat: When I change the name of the function from Index to something else, and call the method in the URL (eg. base-url/asset/foo/234) it works just fine!
Baffling really.. Hoping someone might shed some light on this as I'm pretty much at wit's end.
I know models don't have a 'default' method, but pretty sure classes should respond to 'index'.
Thanks a bunch!
Code:
class Asset extends Controller
{
function __construct()
{
parent::Controller();
$this->load->model('mod_asset');
}
function index($asset_id = FALSE)
{
if (!$asset_id) redirect(base_url().'catalog');
// Page Defaults
$data['page_title'] = "Details";
$data['page_desc'] = "BAR!";
//$data['asset_url'] = $this->mod_asset->get_asset_url($asset_id);
$data['content'] = 'view_asset';
$this->load->view('template', $data);
}
}