/**
  * @param string $url
  * @param string $name
  * @param string $position
  * @param array  $attributes
  *
  * @return $this
  */
 public function link($url, $name, $position = "BL", $attributes = array())
 {
     $match_url = trim(parse_url($url, PHP_URL_PATH), '/');
     if (Request::path() != $match_url) {
         $url = Persistence::get($match_url, parse_url($url, PHP_URL_QUERY));
     }
     $attributes = array_merge(array("class" => "btn btn-default"), $attributes);
     $this->button_container[$position][] = HTML::link($url, $name, $attributes);
     $this->links[] = $url;
     return $this;
 }
Example #2
0
 /**
  * @param string $url
  * @param string $name
  * @param string $position
  * @param array  $attributes
  *
  * @return $this
  */
 public function link($url, $name, $position = "BL", $attributes = array())
 {
     $base = str_replace(Request::path(), '', strtok(Request::fullUrl(), '?'));
     $match_url = str_replace($base, '/', strtok($url, '?'));
     if (Request::path() != $match_url) {
         $url = Persistence::get($match_url, parse_url($url, PHP_URL_QUERY));
     }
     $attributes = array_merge(array("class" => "btn btn-default"), $attributes);
     $this->button_container[$position][] = HTML::link($url, $name, $attributes);
     $this->links[] = $url;
     return $this;
 }
 /**
  * enable auto-back feature on given actions
  * @param  string $actions
  * @param  string $uri
  * @return $this
  */
 public function back($actions = 'insert|update|do_delete', $url = "")
 {
     if ($url == "") {
         if (count($this->links)) {
             $url = array_pop($this->links);
         } else {
             return $this;
         }
     } else {
         $match_url = trim(parse_url($url, PHP_URL_PATH), '/');
         if (Request::path() != $match_url) {
             $url = Persistence::get($match_url);
         }
     }
     $this->back_on = explode("|", $actions);
     $this->back_url = $url;
     return $this;
 }
Example #4
0
 /**
  * enable auto-back feature on given actions
  * @param  string $actions
  * @param  string $uri
  * @return $this
  */
 public function back($actions = 'insert|update|do_delete', $url = "")
 {
     if ($url == "") {
         if (count($this->links)) {
             $url = array_pop($this->links);
         } else {
             return $this;
         }
     } else {
         $base = str_replace(Request::path(), '', strtok(Request::fullUrl(), '?'));
         $match_url = str_replace($base, '/', strtok($url, '?'));
         if (Request::path() != $match_url) {
             $url = Persistence::get($match_url);
         }
     }
     $this->back_on = explode("|", $actions);
     $this->back_url = $url;
     return $this;
 }