Ajax ... help!
Permalink
I've been struggling for hours getting a simple AJAX page working in 5.7. My routes are set up fine, I have a custom controller to handle the ajax calls and I have my block controller working fine. Only problem is the custom controller doesn't display the view.php. It executes the code in public function view(){} but doesn't output the html in view.php. Normally this happens automatically. What am I doing wrong? Using the example Ajax code LikesThisBlock found in the marketplace.
<?php namespace Concrete\Package\Testimonials\Block\Testimonials\Ajax; defined('C5_EXECUTE') or die("Access Denied."); use Concrete\Core\Controller\Controller; use Concrete\Core\Block\BlockType\BlockType; use Concrete\Package\Testimonials\Models\TestimonialsList; class Testimonials extends Controller { protected $testimonials; public function view($page=null){ if(!$page) $page = 1; $bt = BlockType::getByHandle('testimonials'); $testimonialsList = $bt->controller->getPage($page); $this->set('testimonials', $testimonialsList); }
Viewing 15 lines of 16 lines. View entire code block.