Welcome Guest, Not a member yet? Register   Sign In
No Controller Call In Controller Anymore
#1

Hi there,

I would like to make feature request to the thread named 'No Controller Call In Controller Anymore'.

I have created this for CodeIgnitor 3 and it would be nice to have it in the new version CI 4.

This is just an idea of how it's done :
Code:
Get the first registered numeric key

Separate it to segments -> path to class folder,file class,class method,method numeric data,other data
                
http://your-cool-server.com/path/to/folder-class/YourClass/YourMethod/MethodNumericData
                
//Simple Examples :
                            
http://your-cool-server.com/FrontEnd/YourClass/YourMethod/MethodNumericData
http://your-cool-server.com/BackEnd/YourClass/YourMethod/MethodNumericData
                            
http://your-cool-server.com/FrontEnd/User/Register
http://your-cool-server.com/BackEnd/User/ShowProfile/365
                            
http://your-cool-server.com/Web/User/Login
http://your-cool-server.com/Web/User/ShowProfile/365
http://your-cool-server.com/Web/Content/Page/657
                
//More complicated Examples :
http://your-cool-server.com/FrontEnd/Web/User/Login
http://your-cool-server.com/BackEnd/User/ShowProfile/365

//Note : ShowProfile is the class method and 365 is the Profile_ID
http://your-cool-server.com/Public/Web/User/ShowProfile/365/OtherData/ID/248
http://your-cool-server.com/Public/Web/User/ShowProfile/365/Content/Page/1
http://your-cool-server.com/Public/Web/User/ShowProfile/365/Content/Page/657
                            
//If you try to have url like this :
http://your-cool-server.com/BackEnd/User/ShowProfile/UserName
http://your-cool-server.com/BackEnd/User/ShowProfile/MichaelJakson
this is not going to be working because it is based on ID

You can have look in my code :
Click here to see : "No Controller Call In Controller Anymore"
I know it's not maybe the ideal way of creating what i have done,because it's not actually accepting the id yet.

It actually still need some tweeking,which i will do soon or later.

Well and why i actually created this tweak ?

1. I've seen many people over the internet try to do it ...than they got's some issue with session.php or other issues,even i've got that issue when i was trying for example to have nice url when called controller in controller.Which CodeIgnitor is not designed for.

2. It is good to have a structure of the controllers to keep them more organised instead of have too many in one folder.

Incease if i forgot something i'll write it later.
I was writing this in rush.
Reply


Messages In This Thread
No Controller Call In Controller Anymore - by LukasStribrny - 03-22-2017, 04:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB