/** * @param LayoutModel $layout * @param $model * @return null|ViewModel|LayoutModel */ protected function model(LayoutModel $layout, $model = null) { if (!$model instanceof ViewModel || $model instanceof LayoutModel) { return $model; } $layout->model($model); return $layout; }
/** * @param _Layout $layout * @param mixed|Template $model * @return _Layout */ function __invoke(_Layout $layout, $model) { $layout->model($model); return $layout; }