Skip to content

Extend SilverStripe template parser to allow for special <:ComponentName/> syntax so you can pass inner HTML into a SilverStripe template

License

Notifications You must be signed in to change notification settings

symbiote/silverstripe-components

Repository files navigation

Components

Build Status Latest Stable Version Latest Unstable Version Total Downloads License

This module allows you to use special <:TemplateName> syntax to include templates. This allows you to pass inner HTML into a template, much like you can do in React with the children properties. Using the <:TemplateName> syntax will not automatically pass variables in the current scope like <% include %>.

<:MyButtonTemplate 
  icon="fa fa-icon"
  title="$Title"
>
    <span class="text">
        Look at me! Passing HTML in here!
    </span>
</:MyButtonTemplate>
<:SelfClosingTag passvariable="hey" />

Composer Install

composer require symbiote/silverstripe-components

Requirements

  • SilverStripe ^5

Documentation

Credits

About

Extend SilverStripe template parser to allow for special <:ComponentName/> syntax so you can pass inner HTML into a SilverStripe template

Resources

License

Stars

Watchers

Forks

Packages

No packages published