Beispiel #1
0
	/**
	 * Determines whether it links to the current page
	 *
	 * @param  string   destination in format "[[module:]presenter:]action" or "signal!" or "this"
	 * @param  array|mixed
	 * @return bool
	 * @throws \Nette\Application\InvalidLinkException
	 */
	public function isLinkCurrent($destination = NULL, $args = array())
	{
		if (is_array($destination)) {
			foreach ($destination as $link) {
				if (parent::isLinkCurrent($link[0], isset($link[1]) ? $link[1] : array())) {
					return TRUE;
				}
			}
			return FALSE;
		} elseif ($destination !== NULL) {
			if (!is_array($args)) {
				$args = func_get_args();
				array_shift($args);
			}
			return parent::isLinkCurrent($destination, $args);
		}
		return FALSE;
	}