本文整理汇总了PHP中Action::getElement方法的典型用法代码示例。如果您正苦于以下问题:PHP Action::getElement方法的具体用法?PHP Action::getElement怎么用?PHP Action::getElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Action
的用法示例。
在下文中一共展示了Action::getElement方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getElement
/**
* @param mixed $row
* @return \Nette\Utils\Html
* @internal
*/
public function getElement($row)
{
$element = parent::getElement($row);
$primaryValue = $this->propertyAccessor->getProperty($row, $this->getPrimaryKey());
$element->href($this->link('click!', $primaryValue));
return $element;
}
示例2: project
public function project(Action $action)
{
if (false === codex('projects')->has($action->param(0))) {
return;
}
$project = codex('projects')->get($action->param(0));
if ($action->hasParameter(1) && false === $project->hasRef($action->param(1))) {
return;
}
$url = codex()->url($project, $action->param(1), $action->param(2));
$action->getElement()->setAttribute('href', $url);
}
示例3: getElement
/**
* @param mixed $row
* @return \Nette\Utils\Html
* @internal
*/
public function getElement($row)
{
$element = parent::getElement($row);
if ($this->customHref) {
$href = call_user_func_array($this->customHref, [$row]);
} else {
$primaryKey = $this->getPrimaryKey();
$primaryValue = $this->grid->getProperty($row, $primaryKey);
$this->arguments[$primaryKey] = $primaryValue;
$href = $this->presenter->link($this->getDestination(), $this->arguments);
}
$element->href($href);
return $element;
}
示例4: getElement
/**
* @param mixed $row
* @return \Nette\Utils\Html
* @internal
*/
public function getElement($row)
{
$element = parent::getElement($row);
$href = '';
if ($this->customHref) {
$href = callback($this->customHref)->invokeArgs(array($row));
} else {
$primaryKey = $this->getPrimaryKey();
$primaryValue = $this->propertyAccessor->getProperty($row, $primaryKey);
$this->arguments[$primaryKey] = $primaryValue;
$href = $this->presenter->link($this->getDestination(), $this->arguments);
}
$element->href($href);
return $element;
}