comparison core/lib/Drupal/Component/Render/OutputStrategyInterface.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 <?php
2
3 namespace Drupal\Component\Render;
4
5 /**
6 * Provides an output strategy that formats HTML strings for a given context.
7 *
8 * Output strategies assist in transforming HTML strings into strings that are
9 * appropriate for a given context (e.g. plain-text), through performing the
10 * relevant formatting. No sanitization is applied.
11 */
12 interface OutputStrategyInterface {
13
14 /**
15 * Transforms a given HTML string into to a context-appropriate output string.
16 *
17 * This transformation consists of performing the formatting appropriate to
18 * a given output context (e.g., plain-text email subjects, HTML attribute
19 * values).
20 *
21 * @param string|object $string
22 * An HTML string or an object with a ::__toString() magic method returning
23 * HTML markup. The source HTML markup is considered ready for output into
24 * HTML fragments and thus already properly escaped and sanitized.
25 *
26 * @return string
27 * A new string that is formatted according to the output strategy.
28 */
29 public static function renderFromHtml($string);
30
31 }