Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 1.15 KB

override_template.md

File metadata and controls

45 lines (31 loc) · 1.15 KB

Override the template

You can override the default template in several ways:

  • You can put your new template in the app folder:

templates/bundles/APYBreadcrumbTrailBundle/breadcrumbtrail.html.twig

  • You can define the template in your config.yml file:
apy_breadcrumb_trail:
    template: "@APYBreadcrumbTrail/breadcrumbtrail.html.twig"
  • You can define another template in a breadcrumb annotation:
use APY\BreadcrumbTrailBundle\Annotation\Breadcrumb;

#[Breadcrumb("My breadcrumb", route: "my_route")]
#[Breadcrumb(template: "@APYBreadcrumbTrail/breadcrumbtrail.html.twig")]

Or

use APY\BreadcrumbTrailBundle\Annotation\Breadcrumb;

#[Breadcrumb("My breadcrumb", route: "my_route", template: "@APYBreadcrumbTrail/breadcrumbtrail.html.twig")]
  • You can define the template in PHP:
/**
 * @see \APY\BreadcrumbTrailBundle\BreadcrumbTrail\Trail::setTemplate()
 */
$trail->setTemplate('@APYBreadcrumbTrail/breadcrumbtrail.html.twig');
  • You can define the template when you render the breadcrumb trail in your twig file:
{{ apy_breadcrumb_trail_render('@APYBreadcrumbTrail/breadcrumbtrail.html.twig') }}