Noherczeg\Breadcrumb\Breadcrumb::from PHP Метод

from() публичный Метод

Supports method chaining.
public from ( mixed $input = null ) : Breadcrumb
$input mixed Either: PHP array, JSON array, URI string
Результат Breadcrumb
    public function from($input = null)
    {
        $guaranteed_array = $this->inputToArray($input);
        // append all
        foreach ($guaranteed_array as $segment_raw_name) {
            $this->append($segment_raw_name);
        }
        // chaining support :)
        return $this;
    }

Usage Example

Пример #1
0
 /**
  * Test provide InvalidArgumentException thrown as exception
  *
  * @expectedException InvalidArgumentException
  */
 public function testIAException()
 {
     $this->bread->append(false, 'left', true);
     $this->bread->append(null);
     $this->bread->append('nasdal', true, 'asds');
     $this->bread->from(2323);
     $this->bread->from(array());
 }