Source of file BootstrapElementController.php
Size: 1,365 Bytes - Last Modified: 2021-12-23T10:50:34+00:00
/var/www/docs.ssmods.com/process/src/src/Control/BootstrapElementController.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 | <?php namespace Syntro\SilverStripeElementalBaseitems\Control; use SilverStripe\View\Requirements; use DNADesign\Elemental\Controllers\ElementController; use Syntro\SilverStripeElementalBaseitems\Elements\BootstrapSectionBaseElement; /** * Intermediate element controller to handle Templating to make it more * in-line with the general collection. * * @author Matthias Leutenegger <hello@syntro.ch> */ class BootstrapElementController extends ElementController { /** * Location of Templates * * @config * @var string */ private static $template_root = 'Syntro\\BootstrapElemental\\'; /** * Renders the managed {@link BaseElement} wrapped with the current * {@link ElementController}. * * @return string HTML */ public function forTemplate() { $defaultStyles = $this->config()->get('default_styles'); if ($this->config()->get('include_default_styles') && !empty($defaultStyles)) { foreach ($defaultStyles as $stylePath) { Requirements::css($stylePath); } } $template = $this->element->config()->get('controller_template'); $templateRoot = static::config()->get('template_root'); return $this->renderWith([ 'type' => 'Layout', $templateRoot . $template ]); } } |