We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Extended core controller access

How Do I?

vprountzos's avatar
vprountzos
1 posts
10 years ago
vprountzos's avatar vprountzos

Hello everyone,

I am new to codeigniter and so far i am really excited about it. I have run into some problems and i need some help..

I have created a custom core controller in the folder application/core which i would like to use for system wide variables and methods in my application. I did this by following the guide Creating Core System Classes

Here is my code:

class OBJ_System extends CI_Controller {
 
 public function __construct() {
  parent::__construct();
  ....
 }
 
 public function index(){
  //....
 }
 
 public function do_something() {
    .....
  echo "i did it";
 }
}

whenever i try from one of my view to post something to the method do_something() of my core controller

$.post( "OBJ_System/do_something/", {"params": 'do_this'},  function( data ) {
 });

i get the following

404 Page Not Found The page you requested was not found.

can anyone help me with this? How can i post data to my core controller?

ps. I have tried a different approach. I created a controller called System, withing my application/controllers folder. Whenever i post something to this controller

$.post( "system/do_something/", {"params": 'do_this'},  function( data ) {
 });

i get a 403 Forbidden response.. this happens because of the .htaccess file in the system folder. How would you solve this issue?

Thank you in advance..!!!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.