Download the PHP package meita/shams without Composer
On this page you can find all versions of the php package meita/shams. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package shams
Short Description Shams template engine: Blade-style PHP views with .shams templates and component support.
License MIT
Informations about the package shams
Shams Template Engine
Shams is a Blade-style PHP template engine with .shams templates, reusable components, and a compact, dependency-free core.
Features
- Blade-like syntax:
@if,@foreach,@extends,@section,@include,@component, stacks, and more. - HTML-escaped and raw echo tags:
{{ }}and{!! !!}. - Bootstrap 5-friendly built-in components with attribute bags and slots.
- Component tags like
<x-alert>and<x-slot>. - View composers and shared data.
- Optional cache auto-reload for a fast dev loop.
- Helpers like
@csrf,@method,@json,@asset,@once,@env, and attribute helpers.
Installation
Frontend Dependencies (Bootstrap 5, jQuery, DataTables, Select2)
Shams does not bundle CSS/JS. Use your own build pipeline or drop in CDNs. DataTables and Select2 require jQuery.
CDN (quick start)
npm (optional)
Quick Start
Templates live in .shams files:
Template Basics
Echo and Raw Echo
Comments
PHP Blocks
Control Structures
Loop helper $loop is available in @foreach:
Layouts, Sections, and Yields
views/layouts/app.shams
views/home.shams
Stacks
Includes
Components
Tag Components
Directive Components
Built-in Components
Shams ships with ready-to-use components (from resources/components):
- UI:
alert,button,badge,card,datatable - Forms:
form,input,textarea,select,checkbox,radio,switch,file,range,color,input-group,label,fieldset,datalist,option,optgroup,output
Form Components (Bootstrap 5)
Useful options (available on most form components):
label,help,state(validorinvalid),feedbacksize(smorlg),wrapper(trueorfalse),wrapperClassfloating(true) for floating labels on inputs/textareas/selects
Datalist and Output
DataTables Component
Disable DataTables behavior:
Select2 Component
Disable Select2 behavior:
Component Attributes
Attributes are passed into a component attribute bag:
Inside the component:
Custom Component Views
components/notice.shams
Use it:
Class-based Components
View Composers
Custom Directives
Utility Directives
Rendering Strings
Configuration Options
New Ideas Included
- Inline templates via
renderStringfor CMS or database-stored views. - Component tags with slot support, plus attribute bags for clean HTML composition.
- View composers for shared data injection without polluting controllers.
- Bootstrap-ready components plus DataTables and Select2 friendly defaults.
- Helper directives for common HTML attributes and request security.
Tips
- Use
@verbatim ... @endverbatimto prevent Blade parsing inside blocks. - Use
{!! !!}only for trusted HTML. - Turn off
auto_reloadin production for faster renders.
License
MIT