@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
at upstream/main 35 lines 640 B view raw
1<?php 2 3abstract class FuelComponentView 4 extends FuelView { 5 6 private $classes = array(); 7 8 final public function addClass($class) { 9 $this->classes[] = $class; 10 return $this; 11 } 12 13 private function getClasses() { 14 return $this->classes; 15 } 16 17 final protected function newComponentTag( 18 $tag, 19 array $attributes, 20 $content) { 21 22 $classes = $this->getClasses(); 23 if (isset($attributes['class'])) { 24 $classes[] = $attributes['class']; 25 } 26 27 if ($classes) { 28 $classes = implode(' ', $classes); 29 $attributes['class'] = $classes; 30 } 31 32 return javelin_tag($tag, $attributes, $content); 33 } 34 35}