Embed presentation


![config/module.config.php
'data' => [
'type' => Segment::class,
'options' => [
'route' => '/data[/:action[/:id]]',
'defaults' => [
'controller' =>
ControllerIndexController::class,
'action' => 'index',
],
],
],](https://image.slidesharecdn.com/10-190526113618/85/10-view-one-record-3-320.jpg)
![FlowerTable
public function getFlower(int $id)
{
$current=$this->tableGateway->select(['id'=>$id]);
return $current->current();
}](https://image.slidesharecdn.com/10-190526113618/85/10-view-one-record-4-320.jpg)


The IndexController handles viewing a single flower record. It gets the flower ID from the route, retrieves the flower object from the database using the FlowerTable, and passes it to the view template. The view template then displays the flower's name, color, size, and price properties. The module configuration defines the route and default controller/action. The FlowerTable class contains a method to retrieve a flower by ID from the database table gateway.


![config/module.config.php
'data' => [
'type' => Segment::class,
'options' => [
'route' => '/data[/:action[/:id]]',
'defaults' => [
'controller' =>
ControllerIndexController::class,
'action' => 'index',
],
],
],](https://image.slidesharecdn.com/10-190526113618/85/10-view-one-record-3-320.jpg)
![FlowerTable
public function getFlower(int $id)
{
$current=$this->tableGateway->select(['id'=>$id]);
return $current->current();
}](https://image.slidesharecdn.com/10-190526113618/85/10-view-one-record-4-320.jpg)
