yiisoft / yiisoft/view

Allow specifying effective path for a view renderer

Open
#290 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status:under discussion type:feature
Dominant language
PHP
Stars
57
Forks
47
Avg merge
46m
Merged PRs (30d)
1

Description

Proposed new feature or change

An ability to match the renderer not only by extension but also based on the view path:

->withRenderers([
    '**payments**.blade.php' => new PhpTemplateRenderer(),
]);

https://github.com/yiisoft/strings/blob/2.x/src/WildcardPattern.php could be used for wildcards support.

Need to consider performance before implementing it.

See #289

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the withRenderers configuration and review issue #289 for the existing renderer-selection behavior. Examine the proposed yiisoft/strings WildcardPattern utility and assess matching performance before defining the path-based behavior. Done means renderers can be selected by effective view path as well as extension, with coverage for the shown wildcard case.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.