\Drupflare\Anachron\Drupal\Render LegacyRenderer

The renderer, calling procedural render callbacks the way Drupal 7 did.

Drupal 11 refuses a #pre_render, #post_render, #access_callback or #lazy_builder that is a bare function name, because a render array built from user input could name any function. Drupal 7 modules use nothing else. A name that resolves to a function written in PHP outside Drupal's own core directory is called. Internal functions and core's are still refused, so a render array cannot reach system() or a core helper through this door. A method callback is checked by core as before.

Summary

Methods
Properties
Constants
No public methods found
No public properties found
No public constants found
doCallback
No protected properties found
No protected constants found
loadAlterIncludes
isDeliveredFunction
No private properties found
No private constants found

Methods

doCallback()

doCallback(string  $callback_type, string|callable  $callback, array  $args) : mixed

Performs a render callback, trusting procedural functions of the delivered code.

Parameters

string $callback_type

The kind of callback, such as #pre_render.

string|callable $callback

The callback to perform.

array $args

The arguments to pass.

Returns

mixed —

loadAlterIncludes()

loadAlterIncludes() : void

Runs the element info alter on an empty list, once per process.

The alter is where a Drupal 7 module includes the file that defines its callbacks. Core caches the altered definitions, so a process that reads them from the cache never ran it.

Returns

void —

isDeliveredFunction()

isDeliveredFunction(string  $name) : bool

Parameters

string $name

Returns

bool —