Search by

markup-carve / cakephp-carve

dereuromark

CakePHP plugin for Carve: rendering, views, validation, ORM behavior, commands and caching

Package info

github.com/markup-carve/cakephp-carve

Type:cakephp-plugin

pkg:composer/markup-carve/cakephp-carve

Fund package maintenance!

dereuromark

Statistics

Installs: 402

Dependents: 1

Suggesters: 0

Stars: 1

Open Issues: 3

0.1.4 2026-11-12 10:35 UTC

README

This main branch ports the CakePHP plugin to the unreleased Carve 0.2 PHP engine. It pins an engine commit on main through Composer's VCS support. The branch is for integration testing and is not a package release.

Install for development

composer update

Enable the plugin and helper in your CakePHP application:

$this->addPlugin('MarkupCarve/CakeCarve');
$this->addHelper('MarkupCarve/CakeCarve.Carve');

Render

use MarkupCarve\CakeCarve\Carve\CarveRenderer;

$carve = new CarveRenderer();
$html = $carve->toHtml('# Hello');
$result = $carve->render('# Hello', ['preset' => 'comment']);
$headings = $result->toc();
$formatted = $carve->format("a  \nb\n");
$findings = $carve->lint("{#a}\nx\n\n{#a}\ny\n");
$imported = $carve->import('<p>Hello</p>', 'html');

CarveView, the view helper, validation rule, ORM behavior, and the carve render, format, lint, and convert commands use the same renderer. HTML is escaped by default, and unsafe URL schemes are denied. HTML, Markdown and Djot import use Carve; markdown reads GitHub Flavored Markdown as in 0.1 (tables, task lists, strikethrough), and the BBCode importer has been removed. File rendering accepts includeRoot or a Carve include resolver.

Text, Markdown, and ANSI output methods use Carve's built-in writers. Named 0.2 extension bundles are configured through extensions. See rendering and options, extensions, commands, and configuration for details.