Exemple #1
0
 /**
  * Get collection item for key.
  *
  * @param string $key The data key
  * @param mixed $default The default value to return when key does not exists in the collection, default is null
  * @return mixed
  */
 public function get($key, $default = null)
 {
     if ($this->has($key)) {
         $item = parent::get($this->normalizeKey($key), $default);
         return $item['value'];
     }
     return $default;
 }
Exemple #2
0
 /**
  * Get inputs of the route.
  *
  * @return Collection
  */
 public function getInputs()
 {
     $inputs = $this->settings->get('inputs');
     if (is_array($inputs) && count($inputs)) {
         return new Collection($inputs);
     } else {
         return new Collection(array());
     }
 }
Exemple #3
0
 /**
  * Retrieve a single derived request attribute.
  *
  * Retrieves a single derived request attribute as described in
  * getAttributes(). If the attribute has not been previously set, returns
  * the default value as provided.
  *
  * This method obviates the need for a hasAttribute() method, as it allows
  * specifying a default value to return if the attribute is not found.
  *
  * @see getAttributes()
  * @param string $name The attribute name.
  * @param mixed $default Default value to return if the attribute does not exist.
  * @return mixed
  */
 public function getAttribute($name, $default = null)
 {
     return $this->attributes->get($name, $default);
 }
Exemple #4
0
 /**
  * Get the output item by name.
  *
  * @param string $name The output item name
  *
  * @return mixed
  */
 public function getOutput($name)
 {
     return $this->outputs->get($name);
 }