Noherczeg\Breadcrumb\Builders\RichsnippetBuilder::build PHP Метод

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

build: The builder method which creates rich snippet style breadcrumbs https://support.google.com/webmasters/answer/185417?hl=en
public build ( String | null $casing = null, boolean $last_not_link = true, String | null $separator = null, array $properties = [], String | null $ul_class = null, boolean $different_links = false ) : String
$casing String | null Casing option
$last_not_link boolean True if last shouldn't be a link
$separator String | null Separator String
$properties array
$ul_class String | null Class of
    element
$different_links boolean
Результат String
    public function build($casing = null, $last_not_link = true, $separator = null, $properties = array(), $ul_class = null, $different_links = false)
    {
        // always create link on build stage!
        $this->link($last_not_link, $different_links);
        // handle defaults
        $this->separator = is_null($separator) ? $this->config->value('separator') : $separator;
        $this->casing = is_null($casing) ? $this->config->value('casing') : $casing;
        $this->ulClass = is_null($ul_class) ? '' : ' class="' . $ul_class . '"';
        $result = "<ul{$this->ulClass}>";
        foreach ($this->segments as $key => $segment) {
            $result .= $this->appendElement($key, $segment, $properties);
        }
        return $result . '</ul>';
    }