CodeIgniter Forums
Ideas/Suggestions for indicating ajax call for Modal window via URL - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Ideas/Suggestions for indicating ajax call for Modal window via URL (/showthread.php?tid=30747)



Ideas/Suggestions for indicating ajax call for Modal window via URL - El Forum - 05-25-2010

[eluser]jdav3579[/eluser]
Hi,
My application has two views a skeleton and a content view, the content view will be loaded into the skeleton by default. I have links on my application that open up JQuery windows loaded only with the content view.
Code:
function profile($uid, $modal=null){

   #Get content here as $data

  if($modal!=null){
    $this->load->view('content',$data);
  }else{
    $data=$this->load->view('content',$data,true);
    $this->load->view('skeleton',$data);
  }
}

Then in my Javascript I have to append a bit of data to the end of the url to set modal.

This means I have to repeat all of this code for each potential modal window function.
I was wondering if there is a way of using pre-controller and post controller hooks to
check if the variable is set in the pre-controller hook, and in the post controller hook if the variable is set then output only the content, if its not set then put the output into the skeleton - so moving the if/else statement into the post controller.


Ideas/Suggestions for indicating ajax call for Modal window via URL - El Forum - 05-26-2010

[eluser]vitoco[/eluser]
not the same question, but maybe the answer will fit

http://ellislab.com/forums/viewreply/755243/

Saludos


Ideas/Suggestions for indicating ajax call for Modal window via URL - El Forum - 05-27-2010

[eluser]jdav3579[/eluser]
Thanks for the reply - For some reason I get an error saying I can't perform the action when I click the link! Would you be able to post the topic heading so I can search for it?
Many thanks!
John


Ideas/Suggestions for indicating ajax call for Modal window via URL - El Forum - 05-27-2010

[eluser]vitoco[/eluser]
here :
http://ellislab.com/forums/viewthread/156134/
Saludos