# shiftcontroller/4.9.66/hc3/ui/element/labelledinline.php

ShiftController Employee Shift Scheduling, version 4.9.66. 45 lines.

- Page: https://pluginprobe.com/plugins/shiftcontroller/4.9.66/code/hc3/ui/element/labelledinline.php
- Raw: https://pluginprobe.com/plugins/shiftcontroller/4.9.66/raw/hc3/ui/element/labelledinline.php
- Modified: 2018-06-05T08:09:14+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/shiftcontroller/4.9.66/code/hc3/ui/element/labelledinline.php#L10-L20`.

```php
<?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
class HC3_Ui_Element_LabelledInline extends HC3_Ui_Abstract_Collection
{
	protected $htmlFactory = NULL;
	protected $label = NULL;
	protected $content = NULL;

	public function __construct( HC3_Ui $html, $label, $content, $labelFor = NULL )
	{
		$this->htmlFactory = $html;
		$this->label = $label;
		$this->content = $content;
		$this->labelFor = $labelFor;

		$this->add( $this->label );
		$this->add( $this->content );
	}

	public function render()
	{
		// $labelView = $this->htmlFactory->makeElement('label', $this->label);
		$labelView = $this->htmlFactory->makeBlock( $this->label );

		// if( strlen($this->labelFor) ){
			// $labelView->addAttr('for', $this->labelFor );
		// }

		$labelView
			->addAttr('class', 'hc-fs2')
			->addAttr('class', 'hc-muted2')
			// ->addAttr('class', 'hc-mt1')
			;

		$contentView = $this->htmlFactory->makeBlock( $this->content );
		// $contentView
			// ->addAttr('class', 'hc-bold')
			// ;

		$out = $this->htmlFactory->makeListInline( array($labelView, $contentView) )
			->gutter(1)
			;

		return $out;
	}
}
```
