Welcome Guest, Not a member yet? Register   Sign In
How to create routes using the MySQL database
#6

I think arma7x is correct btw.

Why not use the :any command?

Code:
$route['rigatos/(:any)'] = "rigatos/cucuru/$1";.

Now your rigatos controller checks to see if the collected variable is in your database.

Code:
class Rigatos extends CI_Controller {

  public function cucuru($word='')
  {
      // check to see if $word is in the database (or file, or array of acceptable terms, or whatever)
      ....

     // it is, great, do something
     ....

     // it is not, then deal with that
     ....

  }
}

You said
Quote:What I want to do is to have the same content of the "cucuru" method also for other methods, without the need to write other methods.

That is a little confusing, but perhaps the curcuru function needs to be in a library, so other functions can call it at will?

Perhaps if you give a little more information about what you are trying to achieve someone can suggest a better way to achieve it.

Best wishes,

Paul.
Reply


Messages In This Thread
RE: How to create routes using the MySQL database - by PaulD - 03-29-2016, 05:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB