Welcome Guest, Not a member yet? Register   Sign In
custom url to username and maintain urls for controllers
#8

[eluser]InsiteFX[/eluser]
Posting to a 3 year old topic?

Plus there is a better way to do it, welcome controller:
Code:
public function index($username = NULL)
{
        if ( ! empty($username))
        {
            // username has been passed in...
        }
        else
        {
            // default index action...
        }

}

public function _remap($method, $params = array())
{
    if (method_exists($this, $method))
    {
        return call_user_func_array(array($this, $method), $params);
    }

    show_404();
}

// ./application/config/routes.php

// ------------------------------------------------------------------------

/**
* DO NOT! REMOVE THIS LINE.
* This is for the index _remap.
* ------------------------------------------------------------------------
*/
$route['(.*)'] = 'welcome/index/$1';

// DO NOT REMOVE! the above line


Messages In This Thread
custom url to username and maintain urls for controllers - by El Forum - 02-28-2013, 09:54 AM



Theme © iAndrew 2016 - Forum software by © MyBB