コード例 #1
0
ファイル: Event.php プロジェクト: cujan/atlashornin
 /**
  * @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
0
ファイル: Codex.php プロジェクト: codexproject/core
 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
0
ファイル: Href.php プロジェクト: Kaliver/grido
 /**
  * @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
0
ファイル: Href.php プロジェクト: cujan/atlashornin
 /**
  * @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;
 }