Welcome Guest, Not a member yet? Register   Sign In
[SOLVED]Problem with routing from a method to another controller
#1

(This post was last modified: 12-13-2014, 12:22 PM by g3n1u5.)

Hello guys, as I picked CodeIgniter I decided to make a small project, now I have a problem with routing, I have some pages, made step by step from the tutorial: 

I have home and addmovie as pages.

PHP Code:
$route['default_controller'] = 'pages/view';
$route['(:any)'] = "pages/view/$1";
//$route['pages/view/addmovie'] = "movies/add";
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE

The url I am giving the form is the base url of the page

PHP Code:
echo validation_errors();
 
           $attr = array("class" => "col-sm-4""role" => "form");
 
           echo form_open($ADD_URL$attr); 


And now I have another Controller called Movies.php in which there is a function called add which should control the information from the form and eventually add the information to the database. The problem is I dont know how to route the files in a way that when the submit button is pressed it should redirect the form to use the method from Movies.php/add ( controller/method) !

I tried

$route['pages/view/addmovie'] = 'movies/add'; 

but it doesnt work, and I am pretty sure there is a problem with my logic. 

Best regards
g3n1u5!
Reply


Messages In This Thread
[SOLVED]Problem with routing from a method to another controller - by g3n1u5 - 12-13-2014, 05:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB