本文整理汇总了PHP中Nette\Application\UI\Control::link方法的典型用法代码示例。如果您正苦于以下问题:PHP Control::link方法的具体用法?PHP Control::link怎么用?PHP Control::link使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nette\Application\UI\Control
的用法示例。
在下文中一共展示了Control::link方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: link
public function link($destination, $args = [])
{
return parent::link($destination, array_merge($this->defaultLinkParams, $args));
}
示例2: link
/**
* @see PresenterComponent::link($destination, $args = array())
*/
public function link($destination, $args = array())
{
$args[self::CSRF_IDENTIFIER] = $this->generateCsrfLinkToken();
return parent::link($destination, $args);
}
示例3: link
public function link($destination, $args = [])
{
$absolute = $args === TRUE;
$scalarArgs = [];
if (is_array($args)) {
foreach ($args as $key => $arg) {
if (!is_object($arg) && $arg !== NULL) {
$scalarArgs[$key] = $arg;
}
}
}
if ($destination instanceof Rme\Schema) {
$args = ['schemaId' => $destination->id] + $scalarArgs;
$presenter = 'Schema:';
} else {
if ($destination instanceof Rme\Block) {
/** @var Rme\Schema $schema */
$schema = NULL;
if (isset($args[0]) && $args[0] instanceof Rme\Schema) {
$schema = $args[0];
}
$args = ['blockId' => $destination->id, 'schemaId' => $schema ? $schema->id : NULL] + $scalarArgs;
$presenter = 'Block:';
} else {
if ($destination instanceof Rme\Content) {
/** @var Rme\Content $destination */
/** @var Rme\Block $block */
$block = NULL;
if (isset($args[0]) && $args[0] instanceof Rme\Block) {
$block = $args[0];
}
/** @var Rme\Schema $schema */
$schema = NULL;
if (isset($args[1]) && $args[1] instanceof Rme\Schema) {
$schema = $args[1];
}
$id = $destination->id;
if ($destination instanceof Rme\Video) {
$idKey = 'videoId';
$presenter = 'Video:';
} else {
if ($destination instanceof Rme\Blueprint) {
$idKey = 'blueprintId';
$presenter = 'Blueprint:';
} else {
if ($destination instanceof Rme\Blackboard) {
$idKey = 'blackboardId';
$presenter = 'Blackboard:';
} else {
throw new NotImplementedException();
}
}
}
$args = [$idKey => $id, 'blockId' => $block ? $block->id : NULL, 'schemaId' => $schema ? $schema->id : NULL] + $scalarArgs;
} else {
$presenter = $destination;
}
}
}
if ($destination instanceof TitledEntity) {
$args['slug'] = $destination->slug;
}
if ($destination instanceof Entity && $absolute) {
$presenter = "//{$presenter}";
}
/** @noinspection PhpDynamicAsStaticMethodCallInspection */
return NControl::link($presenter, $args);
}