user667030
user667030

Reputation: 495

how to re write url in codeigniter?

For re write url i am using $route['controller/function name/([a-z]+)'] = 'controller/function name/$1'; in codeigniter, my problem is want to take small and caps letters and space also, how is it possible.

Upvotes: 0

Views: 336

Answers (1)

Luke Dennis
Luke Dennis

Reputation: 14550

CodeIgniter uses regexes inside capturing parentheses. Adding case-insensitive letters and white space would look this this:

$route['controller/function_name/([a-zA-Z\s]+)'] = 'controller/function_name/$1';

Upvotes: 3

Related Questions