Welcome Guest, Not a member yet? Register   Sign In
Controller Constructor Question
#1

[eluser]jtrainaldi[/eluser]
Version: 2.0.3

I have the code in my controller.

Code:
public function __construct(){
  if(!IS_AJAX):
    echo "Data was not submitted using AJAX";
  
    //Similiar to exit();
    return;
  endif;
}

public function getData(){

  echo 'Getting Data';

}

If i call the function getData is there a way to stop the entire controller if it recognizes that the form was not submitted via AJAX? The return will not continue in the controller but the getData function is still being called.

I don't want to have to repeat that IS_AJAX condition on each one of my controller's functions. Are there any other ways to go about this?

JR




Theme © iAndrew 2016 - Forum software by © MyBB