0
votes

I have a directory structure: application->classes->controller->school->admin->management->student->student.php

Having route:

    Route::set('school_admin_management_student', 
    '<prefix>/<directory>(/<controller>(/<action>(/<id>)))',
 array('prefix'=>'demo', 'directory'=>'school/admin/management/student'))
        ->defaults(array(
            'directory'=>'school/admin/management/student',
            'controller'=>'student',
            'action'=>'index',
        ));

Every thing is okay as far as access school, I have to use the same application for college, only want to change the url upfront, but using the same code developed for school for e.g:

If someone access: http://example.com/demo/school/admin/management/student it will show the logic developed in action index,

now what I want is,

if someone access: http://example.com/demo/college/admin/management/student the same controller should be call, definitely, with some logic change on the basis of url detection.

I'll be very thankful to you, If you can give me any hint, because, I have to complete my project in next coming days, please help me out!

Faisal Faridi

1
I think it would be easier to route to another controller that does things else (if needed). That could inherit from the school controller or both have the same parent that contains the shared logickero

1 Answers

0
votes

I agree with @kingkero. You should route to a different controller and inherit from school controller.

The other option you have is to change the action. One for school and one for college.