php - CakePHP 2.4 ignoring view -
i can't figure out @ moment why view not being displayed.
controller: (/app/controller/eventscontroller.php)
<?php class eventscontroller extends appcontroller { public $helpers = array('html', 'form'); function index() { $data = $this->event->find('all'); $this->set('data', $data); } } ?>
view: (/app/view/events/index.ctp)
<?php echo "<table border='1'>"; for($i=0; $i<count($data); $i++) { echo "<tr>"; echo "<td>" . $data[$i]['event']['id'] . "</td>"; echo "<td>" . $data[$i]['event']['start'] . "</td>"; echo "<tr>"; } echo "<table>"; //die; ?>
however, if uncomment die; in last line content appears. it's not it's being skipped, it's more being ignored afterwards.
not sure if needed routes.php pretty standard:
router::connect('/', array('controller' => 'events', 'action' => 'index', 'home')); router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display')); cakeplugin::routes(); require cake . 'config' . ds . 'routes.php';
i accidentally removed echo $this->fetch('content');
in default.ctp under /app/view/layouts.