Render the given breadcrumb trail.

@access public

@param Carbon_Breadcrumb_Trail $trail The trail object.
@param bool                    $return Whether to return the output.
@return string|void $output The output HTML if $return is true.
168538
public function render( Carbon_Breadcrumb_Trail $trail, $return = false ) {
		// If the items are less than the minimum, nothing should be rendered.
		if ( $trail->get_total_items() < $this->get_min_items() ) {
			return;
		}

		// Prepare the trail & renderer for rendering.
		$this->prepare_for_rendering( $trail );

		// Render the items.
		$items_output = $this->render_items( $trail );

		// Implode the breadcrumb items and wrap them with the configured wrappers.
		$output  = $this->get_wrapper_before();
		$output .= implode( $this->get_glue(), $items_output );
		$output .= $this->get_wrapper_after();

		if ( $return ) {
			return $output;
		}

		echo wp_kses( $output, wp_kses_allowed_html( 'post' ) );
	}
427530
def breadcrumb_trail(options = {})
      return enum_for(:breadcrumb_trail) unless block_given?

      valid?(options)
      options = Loaf.configuration.to_hash.merge(options)
      _breadcrumbs.each do |crumb|
        name = title_for(crumb.name)
        path = url_for(_expand_url(crumb.url))
        current = current_crumb?(path, crumb.match)

        yield(Loaf::Breadcrumb[name, path, current])
      end
    end
814527
public function dump($return = false){
		$sql = PHP_SAPI === 'cli'
			? preg_replace('/\s+/', ' ', $this->parse()) . "\n"
			: Manager::highlightSql($this->parse());
		if(!$return)
			echo $sql;
		return $return ? $sql : $this;
	}
10698
public function breadcrumb(BreadcrumbItem $mainItem, Breadcrumb $breadcrumb)
    {
        $this->dataCollection->add('mainItem', $mainItem);
        $this->dataCollection->add('breadcrumb', $breadcrumb);

        return $this->render('Breadcrumb');
    }
490038
public function render(array $breadcrumb) : void
    {
        $admin = ['link' => ':Base:Admin:Dashboard', 'title' => 'Admin'];

        if ($this->presenter->isLinkCurrent(':Base:Admin:Dashboard'))
        {
            $admin = ['title' => 'Admin'];
        }

        array_unshift($breadcrumb, $admin);

        $this->template->breadcrumb = $breadcrumb;

        $this->template->setFile(__DIR__ . '/templates/breadcrumb.latte');
        $this->template->render();
    }
88876
public function dump($return = false, $print = true, $depth = 1)
    {
        $dump = $this->data();
        $links = $this->links;

        foreach ($links as $key => $link) {
            if ($depth < 1) {
                try {
                    $related = $this->{$key};
                } catch (ServerException $e) {
                    $related = array('$error' => $e->getMessage());
                }

                if ($related instanceof Resource) {
                    $dump[$key] = $related->dump(true, false, $depth+1);
                } else {
                    $dump[$key] = $related;
                }
            }
        }
        if ($links) {
            $dump['$links'] = $this->dump_links($links);
        }

        return $print ? print_r($dump, $return) : $dump;
    }
909569
public function render($path = 'basic', $views = null)
    {
        $view = new View();
        if (is_null($views)) {
            $views = __DIR__.'/views/';
        }

        $view->createBlade($views, $this->_config->get('cache'));

        return $view->with('pagination', [
            'currentPage' => $this->_page,
            'totalPages'  => $this->_totalPages,
            ])->render($path);
    }
392556
public function output($view = null, $return = false) {
        if ($view instanceof View) {
            $this->view = $view;
        } else if (is_string($view) || is_bool($view) || is_numeric($view)) {
            $this->view = new SimpleView ($view);
        } else if (is_array($view)) {
            $this->view = new JsonView ($view);
        } else if (is_object($view)) {
            $this->view = new JsonView (get_object_vars($view));
        }

        if ($this->view instanceof View) {
            if ($return) {
                $content = $this->view->render();

                return $content;
            } else {
                $this->view->echoHeader();
                $content = $this->view->render();
                if (is_string($content) && $content) {
                    $content = apply_filter('before_output_content', $content, $this->view);
                    echo $content;
                }
            }
        } else if (!$return) {
            Response::respond(404);
        }

        return null;
    }
728677
final protected function display (bool $return=FALSE)
	{
		if (file_exists($this->file)):
			$output = file_get_contents($this->file);
			foreach ($this->assignedVariables as $key => $value) 
				$output = preg_replace('/{'.$key.'}/', $value, $output);
		else:
			$output = "*** Missing template error: {$this->file} ***";
		endif;

		if ($return)
			return $output;
		else
			echo $output;
	}
573419
public function executeRedirection($return = false)
    {
        $html = $this->createForm();
        $html .= '<script>document.forms["'.$this->_setNameForm.'"].submit();</script>';

        if (!$return) {
            echo $html;

            return null;
        }

        return $html;
    }
366299
public function renderBreadcrumbsAction(ResourceNode $node, array $_breadcrumbs)
    {
        //this trick will never work with shortcuts to directory
        //we don't support directory links anymore
        $nodeFromSession = $this->request->getSession()->get('current_resource_node');
        $node = $nodeFromSession !== null ? $nodeFromSession: $node;
        $workspace = $node->getWorkspace();
        $ancestors = $this->resourceManager->getAncestors($node);

        return array(
            'ancestors' => $ancestors,
            'workspaceId' => $workspace->getId(),
        );
    }
55049
public function renderGraph($outputPath = './workflow.png', $stopAfterExecution = true)
    {
        /*
         * This example is based on http://martin-thoma.com/how-to-draw-a-finite-state-machine/
         * Feel free to tweak the rendering output. I have decided do use the most simple
         * implementation over the fancy stuff to avoid additional complexity.
         */
        $template
            = '
            digraph finite_state_machine {
                rankdir=LR;
                size="%d"

                node [shape = doublecircle]; start;
                node [shape = circle];

                %s
            }
        ';

        $pattern = ' %s  -> %s [ label = "%s" ];';

        $_transitions = [];
        foreach ($this->workflowConfiguration['states'] as $state) {
            if (array_key_exists('transitions_from', $state)) {
                $transitions_from = $state['transitions_from'];
                foreach ($transitions_from as $from) {
                    if (is_array($from)) {
                        $_transitions[] = sprintf(
                            $pattern,
                            $from['status'],
                            $state['name'],
                            '<< IF '
                            . $this->convertToStringCondition($from['result']) . ' >>' . $state['name']
                        );
                    } else {
                        $_transitions[] = sprintf($pattern, $from, $state['name'], $state['name']);
                    }
                }
            } else {
                if ('type' == 'exception') {
                    $_transitions[] = 'node [shape = doublecircle]; exception;';
                }
            }
        }
        file_put_contents('/tmp/sm.gv', sprintf($template, count($_transitions) * 2, implode("\n", $_transitions)));
        shell_exec('dot -Tpng /tmp/sm.gv -o ' . $outputPath);

        if ($stopAfterExecution) {
            //exit;
        }
    }
1208023
protected function renderCrumbs()
    {
        end($this->breadcrumbs);
        $lastKey = key($this->breadcrumbs);

        $output = '';

        $hrefSegments = array();

        $position = 1;

        foreach ($this->breadcrumbs as $key => $crumb) {
            $isLast = ($lastKey === $key);

            if ($crumb['hrefIsFullUrl']) {
                $hrefSegments = array();
            }

            if ($crumb['href']) {
                $hrefSegments[] = $crumb['href'];
            }

            $href = implode('/', $hrefSegments);

            if (!preg_match('#^https?://.*#', $href)) {
                $href = "/{$href}";
            }

            $output .= $this->renderCrumb($crumb['name'], $href, $isLast, $position);
            $position++;
        }

        return $output;
    }
746844
public function render(): string
    {
        if (empty($this->breadcrumbs)) {
            return '';
        }

        $classes = $this->getClasses('listElementClasses');
        $element = $this->getOption('listElement');

        return "<{$element} class=\"{$classes}\">" . $this->renderCrumbs() . "</{$element}>";
    }
229113
protected function afterRunInBreadCrumbSupport($action, $view, $method) {
        /**@var Annotation $ann */
        $ann = $method->anns;
        if ($view instanceof View) {
            $breadCrumbs = [];
            $crumb       = $ann->getString('crumb');
            if ($crumb && preg_match('#^([a-z][a-z_\d]*)-(\d+)(\s+.*)?$#i', trim($crumb), $ms)) {
                $sname       = '_wula_bdCbs_' . $ms[1];
                $breadCrumbs = sess_get($sname, []);
                $level       = intval($ms[2]);
                $data        = $view->getData();
                $title       = isset($data['crumbTitle']) && $data['crumbTitle'] ? $data['crumbTitle'] : false;
                if (!$title && isset($ms[3])) {
                    $title = trim($ms[3]);
                }
                if ($title) {
                    $breadCrumbs[ $level ] = [$title, Router::getFullURI()];
                    ksort($breadCrumbs);
                    $breadCrumbs        = array_slice($breadCrumbs, 0, $level + 1, true);
                    $_SESSION[ $sname ] = $breadCrumbs;
                }
            }

            if ($crumb && $breadCrumbs) {
                $view->assign('breadCrumbs', $breadCrumbs);
            }
        }
        unset($ann);

        return $view;
    }
788930
public function render()
    {
        if ($breadcrumbs = $this->generator->generate()) {
            return $this->renderer->render(config('breadcrumbs.view'), $breadcrumbs);
        }
    }
508011
private function mapRoute(string $pattern, callable $callback)
    {
        $word = self::getPattern($pattern);

        $pattern = '/^' . str_replace('/', '\/', $word) . '$/';
        $this->routes[$pattern] = $callback;
    }