marko/view

Marko Framework View - Templating interfaces and contracts

Maintainers

Package info

github.com/marko-php/marko-view

pkg:composer/marko/view

Statistics

Installs: 4

Dependents: 3

Suggesters: 0

Stars: 0

0.0.1 2026-03-25 17:53 UTC

This package is auto-updated.

Last update: 2026-03-25 21:07:19 UTC


README

View and template rendering interface -- defines how controllers render templates, not which engine is used.

Installation

composer require marko/view

Note: You also need a view driver. Install marko/view-latte for Latte template support.

Quick Example

use Marko\Routing\Attributes\Get;
use Marko\Routing\Http\Response;
use Marko\View\ViewInterface;

class PostController
{
    public function __construct(
        private readonly ViewInterface $view,
    ) {}

    #[Get('/posts/{id}')]
    public function show(int $id): Response
    {
        return $this->view->render('blog::post/show', [
            'post' => $this->findPost($id),
        ]);
    }
}

Documentation

Full usage, API reference, and examples: marko/view