for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @link https://github.com/roboapp
* @copyright Copyright (c) 2016 Roboapp
* @license [MIT License](https://opensource.org/licenses/MIT)
*/
namespace roboapp\crud;
* Action displays an existing model.
*
* @author iRipVanWinkle <[email protected]>
* @since 1.0
class View extends BaseAction
{
* @var string name of the view
public $view = 'view';
* @var string the name variable model in the view template
public $nameVariableModel = 'model';
* Views existing record.
* @param mixed $id ID of the model to be view
* @return mixed response
public function run($id)
$model = $this->getModel($id);
return $this->controller->render($this->view, [
$this->nameVariableModel => $model,
]);
}