Skip to content

Instantly share code, notes, and snippets.

@joshuapaling
Created October 10, 2013 02:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshuapaling/6911950 to your computer and use it in GitHub Desktop.
Save joshuapaling/6911950 to your computer and use it in GitHub Desktop.
<?php
// put this code in app/View/Layouts/ajax.ctp
echo $this->fetch('content');
?>
// if the request is via ajax, then render an Element, containing just the little bit of the page you want to update.
if ($this->request->is('ajax')) {
$this->render('/Elements/my_element');
return; // return the form only
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment