CodeIgniter Forums

Full Version: generate routes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
easy generate routes concept:

https://github.com/yonineitor/routes-ci

easy to use
PHP Code:
/**
 * @route::arguments
 */
class Example3 extends CI_Controller
{
  
/**
 * @route::numeric-values/(:num)/(:num)
 */
  
function numeric$a $b ){
    
//output url: /arguments/numeric-values/$1/$2
  
}

 
/**
 * @route::any-values/(:any)
 */
  
function any$a ){
    
//output url: /arguments/any-values/$1
  
}

  
/**
 * @route::several/(:num)/(:num)/(:any)/(:any)
 */
  
function several$a$b $c$d  ){
    
//output url: /arguments/several/$1/$2/$3/$4
  


Only run file on FCPATH: php routes

enjoy!