Welcome Guest, Not a member yet? Register   Sign In
How to extend to more than two controllers?
#1

[eluser]shinokada[/eluser]
I want to extend the ci controller.

one for front end and one for back-end.

I assume I need to extend first controller to MY_Contoller.

Q1. However I am not sure after this.

Q2. When I see ci backend pro, My_Controller is file name and inside it is Site_Controller extends Controller.

Can I have a different name than file name?

Q3. Where can I put extended controllers? In applications/libraries?

Q4. Do I have to autoload my new controllers?

Thanks in advance.
#2

[eluser]imn.codeartist[/eluser]
[quote author="shinokada" date="1263663134"]I want to extend the ci controller.

one for front end and one for back-end.

I assume I need to extend first controller to MY_Contoller.

Q1. However I am not sure after this.

Q2. When I see ci backend pro, My_Controller is file name and inside it is Site_Controller extends Controller.

Can I have a different name than file name?

Q3. Where can I put extended controllers? In applications/libraries?

Q4. Do I have to autoload my new controllers?

Thanks in advance.[/quote]

Reply to your questions:
Q1: Make yourself clear first

Q2: Its not necessary that MY_Controller.php must have MY_Controller class can have any and as much as you can

Q3: Yeah place in the applications/libraries

Q4: Not necessary as long as its in the applications/Libraries .. CI will load automatically as long as the file name starts with MY_




Theme © iAndrew 2016 - Forum software by © MyBB