Download the PHP package kaiseki/wp-template-renderer without Composer
On this page you can find all versions of the php package kaiseki/wp-template-renderer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kaiseki/wp-template-renderer
More information about kaiseki/wp-template-renderer
Files in kaiseki/wp-template-renderer
Package wp-template-renderer
Short Description Render WordPress template parts by slug or from a class, with a configurable class-to-slug generator
License MIT
Homepage https://github.com/kaisekidev/kaiseki-wp-template-renderer
Informations about the package wp-template-renderer
kaiseki/wp-template-renderer
Render WordPress template parts by slug or from a class, with a configurable class-to-slug generator.
Two renderers, both wired through ConfigProvider:
TemplateRenderer— renders a template part by slug from a configurable base directory under the active theme (defaulttemplate-parts), capturing its output as a string.ClassTemplateRenderer— renders a template part that lives next to a given object's class file, deriving the slug from the class short name (kebab-cased by default) via aClassSlugGeneratorInterface.
Installation
Requires PHP 8.2 or newer.
Usage
Register ConfigProvider with your laminas-style config aggregator. It declares the renderer factories
and aliases ClassSlugGeneratorInterface to the kebab-case ClassTemplateSlugGenerator, and exposes a
template_renderer config key for the defaults:
Rendering a template part by slug
The base directory is configurable via template_renderer.template_renderer.template_directory.
Rendering a template part from a class
The slug is produced by the ClassSlugGeneratorInterface binding (kebab-cased class short name by
default); the template-name suffix defaults to
template_renderer.class_template_renderer.template_name.
Both renderers throw a RuntimeException when the resolved template file does not exist.
Development
License
MIT — see LICENSE.
All versions of wp-template-renderer with dependencies
jawira/case-converter Version ^3.5
kaiseki/config Version ^2.0
kaiseki/wp-hook Version ^2.0
psr/container Version ^1.1 || ^2.0