<?php
 namespace Moto\Twig\Extension; use Moto; class EntertainmentExtension extends AbstractExtension { protected $_name = 'motoEntertainment'; protected $_cssClasses = [ 'animationDisabled' => 'moto-entertainment__animation_disabled', 'animationIgnoring' => 'moto-entertainment__animation_ignore-visibility', 'videoDisabled' => 'moto-entertainment__video_disabled', 'playingDisabled' => 'moto-entertainment__playing_disabled', ]; public function getGlobals() { return array( 'Entertainment' => $this ); } public function getCssClass($name, $default = '') { $result = Moto\Util::arrayOnly($this->_cssClasses, $name); if (is_array($result)) { $result = implode(' ', $result); } $result = (string) $result; $result = trim($result); if ($result === '') { $result = $default; } return (string) $result; } } 