/** * Builder method which returns with a result type as required. * Supports separator switching, casing switching, and custom property * insertion from an array (only if output is set to html!). * * @param String $format Format of the output * @param String|null $casing Casing of Segments * @param bool $last_not_link * @param String|null $separator Separator String (not there in Foundation!) * @param array $customizations Array of properties (only in HTML!) * @param bool $different_links * @throws \OutOfRangeException * @return String */ public function build($format = null, $casing = null, $last_not_link = true, $separator = null, $customizations = array(), $different_links = false) { $format = is_null($format) ? $this->config->value('output_format') : $format; if (in_array($format, $this->build_formats)) { // compose the namespaced name of the builder which we wanted to use $builder_name = '\\Noherczeg\\Breadcrumb\\Builders\\' . ucfirst($format) . 'Builder'; // instantiate it $this->builder_instance = new $builder_name($this->segments, $this->base_url, $this->config); // return with the results :) return $this->builder_instance->build($casing, $last_not_link, $separator, $customizations, $different_links); } else { throw new OutOfRangeException("Provided output format({$format}) is not supported!"); } }