Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Codeigniter] Calling controller from outside framework using URI-segments

Featured Replies

My apologies if this method of calling controllers is absurd or common knowledge but I've recently started using frameworks to bear with me here.

 

I'm working on the second version of a lightweight cms and this time I'm using a framework to help ease the workload a bit. Our aim with this cms is to keep it as simple as possible and installation is just to extract our cms into the website's root directory. A user's directory structure will mostly look as such:

 

|-- images
|-- css
|-- js
|-- cms <-- holds framework
 |-- application
 |-- system
 |-- index.php
|-- index.php <-- call controller using URI segment

 

Lets say the user wants to display a list of images uploaded using our cms. He would then call our controller using a URI-segment such as: http://localhost/controller/ from within index.php located in the root. We thought it would be most user-friendly to be able to use our cms' features without having to split the layout into MVC form.

 

A working solution we have is to call the controllers using ajax but if javascript were to be disabled the website would be rendered utterly useless.

 

Another suggestion was to use PHP cURL and I found this project on github which is a codeigniter library. The only problem is that we are trying to access codeigniter functions from OUTSIDE the framework so this might not be the best option.

 

Lastly, I came across another PHP cURL question posted on stack overflow and it seems that PHP has a cURL library as well.

 

What would be the proper solution to achieve our aim of easily using our cms without having the user dabble into any MVC-architecture. We used it to create the cms but the user should not have to learn how it works in order to use it.

Edited by larsson719

  • Author

As I'm still new to codeigniter I was unaware of templates and I'm now doing some research, however, I'm still having a hard time grasping the concept. No worries though I'll just keep experimenting until it makes sense or I break my installation!

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.