Exemple #1
0
 /**
  * @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;
 }
Exemple #2
0
 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);
 }
Exemple #3
0
 /**
  * @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;
 }
Exemple #4
0
 /**
  * @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;
 }