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.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -