/** * Gets the instance of a widget * @param string $widget Machine name of the widget * @return \ride\library\cms\widget\Widget */ public function getWidget($widget) { if (!$widget) { return null; } try { $widget = $this->dependencyInjector->get('ride\\library\\cms\\widget\\Widget', $widget); } catch (DependencyNotFoundException $exception) { $widget = null; } return $widget; }
/** * Gets the a specific layout * @param string $layout Machine name of the layout * @return Layout */ public function getLayout($layout) { return $this->dependencyInjector->get('ride\\library\\cms\\layout\\Layout', $layout); }