Download the PHP package diatechnis/vellum without Composer
On this page you can find all versions of the php package diatechnis/vellum. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download diatechnis/vellum
More information about diatechnis/vellum
Files in diatechnis/vellum
Package vellum
Short Description A site building library based loosely on atomic design principles.
License MIT
Informations about the package vellum
Vellum
Vellum is a modular component building library written in PHP loosely inspired by atomic design principles.
See some Vellum components in action with the Vellum Example project.
Why Use Vellum?
Here are a few benefits from adopting Vellum.
Structured
How many times have you forgotten what data a view file needs and had to sift through the html to figure out what to pass to it?
Vellum uses PHP classes with display types and inputs that document an API that you can refer to when using a component.
Don't Repeat Yourself
Write components once and use them again and again.
If you have your components in a separate library, then you can reuse them in every project.
Write Once
Once a component is coded, you can use it everywhere. No need to keep writing <a></a>
tags every time.
Consistency and Compliance
Once you have accessible, on-brand components, your team can use the same html every time without worrying about missing important attributes or classes.
Concepts
Atomic design gives the designer tools to build interfaces that work together "to create interface design systems in a more deliberate and hierarchical manner." - http://atomicdesign.bradfrost.com/chapter-2/
Similarly Vellum provides PHP interfaces that allow a designer/team to create their design system hierarchy. Vellum components can be instantiated and rendered to build UI. Finally, Vellum provides a means of explicitly declaring parameters to which each component can consume and respond.
Component
Vellum provides \Vellum\Contracts\AbstractComponent
to extend. The AbstractComponent
implements several interfaces that are explained below.
Renderers
The goal of a component is to be consumed by a user, human or otherwise. Vellum provides a means of consumption consumption via a Renderer. Vellum assumes that a component will be rendered, but it's agnostic to how it will happen.
Every component is injected with a designer-supplied Renderer (a PHP object that implements \Vellum\Contracts\Renderers\RenderInterface
). This allows a team to choose its templating engine of choice (Twig, Plates, etc...). There is a companion library for Twig if interested.
Paths
Vellum needs to know where your components are in order to instantiate and render them. But, once again, Vellum wants to be as agnostic as possible about how and where to find them.
Vellum provides \Vellum\Path\ClassPathInterface
and \Vellum\Path\TemplatePathInterface
that to find component classes and templates respectively. Basic implementations reside at \Vellum\Path\SimpleClassPathResolver
and SimpleTemplatePathResolver
.
Inputs
Supplying instructions to a component tells it what content to render, but what instructions can you give it? Inputs provide you with an API that determines what instructions each component expects, in what data type each instruction should be submitted, and what the default value would be if no instructions are supplied.
Options
Some inputs may have a discrete number of expected choices (Yes/No or 1-5). Options express those choices.
Display Types
Display types are a special type of input. Some components may use the same data but can be displayed in very different ways. For example, a preview list of blog posts can be displayed using a card interface, a carousel, or as a simple <ul>
list. It's the same blog data, but the html is very different. Let's also say that each way of displaying the data has inputs that only apply to that particular view type (e.g. slide transition speed for the carousel view). Display types allow you to define the different ways to view a component as well as inputs specific to each display.
Arguments
Inputs, options and display types provide the means of creating the instructions a component needs to properly render itself. The supplied instruction data gets instantiated into an Arguments object that the renderer can use to access the instructions in the template/view.
All versions of vellum with dependencies
roave/security-advisories Version dev-master
adbario/php-dot-notation Version ^2.0