/** * @param \Nette\Application\UI\PresenterComponent $component * @param string $destination * @param array $args */ public function onLink(PresenterComponent $component, $destination, array $args = []) { $component->link($destination, $args); if ($request = $component->getPresenter()->lastCreatedRequest) { return $this->onPresenter($request); } }
/** * Converts link to URL. * @return string */ public function __toString() { try { return $this->component->link($this->destination, $this->params); } catch (\Exception $e) { Nette\Diagnostics\Debugger::toStringException($e); } }
/** * Converts link to URL. * @return string */ public function __toString() { try { return (string) $this->component->link($this->destination, $this->params); } catch (\Exception $e) { trigger_error("Exception in " . __METHOD__ . "(): {$e->getMessage()} in {$e->getFile()}:{$e->getLine()}", E_USER_ERROR); } }
public function getComponents($deep = FALSE, $filterType = NULL) { $components = $this->component->getComponents($deep, $filterType); $result = []; foreach ($components as $name => $component) { $result[$name] = $this->wrapComponent($name, $component); } return new RecursiveComponentIterator($result); }
public function getStateForComponent(PresenterComponent $component) { $name = $component->getUniqueId(); if (isset($this->state->{$name})) { return $this->state->{$name}; } else { $state = new \Nette\Utils\ArrayHash(); $this->state->{$name} = $state; return $state; } }
/** * Converts link to URL. * @return string */ public function __toString() { try { return (string) $this->component->link($this->destination, $this->params); } catch (\Throwable $e) { } catch (\Exception $e) { } if (isset($e)) { if (func_num_args()) { throw $e; } trigger_error("Exception in " . __METHOD__ . "(): {$e->getMessage()} in {$e->getFile()}:{$e->getLine()}", E_USER_ERROR); } }
/** * @param Nette\Application\UI\PresenterComponent $component * @return array */ public static function nullLinkParams(Nette\Application\UI\PresenterComponent $component) { $parent = $component; $presenter = $component instanceof Nette\Application\UI\Presenter ? NULL : $component->lookup('Nette\\Application\\UI\\Presenter'); $params = array(); do { if ($parent && method_exists($parent, 'getPersistentParams')) { $name = $parent instanceof Nette\Application\UI\Presenter ? '' : $parent->lookupPath(get_class($presenter)); foreach ($parent->reflection->getPersistentParams() as $param => $info) { $params[($name ? $name . $component::NAME_SEPARATOR : NULL) . $param] = $info['def'] ?: NULL; } } } while ($parent && ($parent = $parent->getParent())); return $params; }
/** * @param Google $google */ public function __construct(Google $google) { $this->google = $google; $this->config = $google->config; $this->session = $google->getSession(); parent::__construct(); }
/** * @param \Nette\ComponentModel\Container $obj */ protected function attached($obj) { parent::attached($obj); if ($obj instanceof Nette\Application\IPresenter) { $this->currentUrl = new UrlScript($this->link('//response!')); } }
/** * @param string $name Table column name * @param string $label Column label */ public function __construct($container, $name, $label, $parent) { parent::__construct($container, $name); $this->label = $label; $this->parent = $parent; $this->valueEditor = function ($value) { return $value; }; return $this; }
public function __construct(\Fabian\Linkedin\Linkedin $linkedin) { parent::__construct(); $this->linkedin = $linkedin; }
public function __construct($container, $name, $label, $parent) { parent::__construct($container, $name); $this->label = $label; $this->parent = $parent; }
public function __construct($factory) { parent::__construct(); $this->factory = new Nette\Callback($factory); }
public function __construct(callable $factory) { parent::__construct(); $this->factory = $factory; }
/** * @return string */ public function getUrl() { return NULL === ($param = $this->getParam()) ? $this->presenterComponent->link($this->destination) : $this->presenterComponent->link($this->destination, $param); }
/** * @param SkautIS $skautis */ public function __construct(SkautIS $skautis) { $this->skautis = $skautis; $this->session = $skautis->getSession(); parent::__construct(); }
/** * @param callable */ public function __construct($factory) { parent::__construct(); $this->factory = Nette\Utils\Callback::check($factory); }
protected function createComponent($name) : Nette\ComponentModel\IComponent { return new Template($name, $this->templates, get_class($this->getParent())) ?: parent::createComponent($name); }
/** * Helper for {form ...} macro. * * @param Nette\Forms\Form|string form instance or form name in given control * @param Nette\Application\UI\PresenterComponent * @param array list of modifiers (name => value) * @return Nette\Forms\Form */ public static function beginForm($form, Nette\Application\UI\PresenterComponent $control, array $modifiers = NULL) { $form = ($form instanceof Nette\Forms\Form ? $form : $control->getComponent($form)); self::$containerStack = array($form); if ($modifiers) self::addAttributes($form->getElementPrototype(), $modifiers, array('class', 'style')); $form->render('begin'); return $form; }