eZ\Publish\Core\FieldType\RichText\Converter\Xslt::__construct PHP Метод

__construct() публичный Метод

Constructor.
public __construct ( string $stylesheet, array $customStylesheets = [] )
$stylesheet string Stylesheet to use for conversion
$customStylesheets array Array of XSL stylesheets. Each entry consists in a hash having "path" and "priority" keys.
    public function __construct($stylesheet, array $customStylesheets = array())
    {
        $this->stylesheet = $stylesheet;
        // Grouping stylesheets by priority.
        foreach ($customStylesheets as $customStylesheet) {
            $this->customStylesheets[$customStylesheet['priority']][] = $customStylesheet['path'];
        }
    }

Usage Example

Пример #1
0
 public function __construct($stylesheet, ConfigResolverInterface $configResolver)
 {
     $customStylesheets = $configResolver->getParameter('fieldtypes.ezrichtext.input_custom_xsl');
     $customStylesheets = $customStylesheets ?: array();
     parent::__construct($stylesheet, $customStylesheets);
 }