<?php
class Controller_Add extends Controller {
public function action_index() {
$data['records'] = DB::select('idea', 'timestamp')->from('idea')->as_object()->execute();
$this->response->body = View::factory('howdy-view', $data);
}
}
?>
<h1>Howdy</h1> <table> <tr> <th>Idea</th> <th>Date</th> <th>Delete</th> </tr> <?php foreach($records as $r): ?> <tr> <td><?=$r->idea?></td> <td><?=$r->timestamp?></td> <td>del</td> </tr> <?php endforeach; ?> </table>
$data['records'] = DB::select('idea', 'timestamp')->from('idea')->execute()->as_array();
<?php foreach($records as $r): ?> <p><?=$r['idea']?></p> <p><?=$r['timestamp']?> <?php endforeach; ?>
<?=$r->idea?>
<?php echo $r->idea; ?>
<?php foreach($records as $r): ?> <p><?php echo $r->idea; ?></p> <p><?php echo $r->timestamp; ?> <?php endforeach; ?>
<?php
class Controller_Add extends Controller {
public function action_index() {
$data['records'] = DB::select('idea', 'timestamp')->from('idea')->execute();
$this->response->body = View::factory('howdy-view', $data);
}
}
?>
<?php foreach($records as $r): ?> <p><?php echo $r->idea; ?></p> <p><?php echo $r->timestamp; ?> <?php endforeach; ?>
Just skim read it whilst waiting for code to compile.
Yes you are correct.
That is basically how I have done it.
It looks like you're new here. If you want to get involved, click one of these buttons!