This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
vbbs/app/Classes/FrameFields.php

31 lines
535 B
PHP
Raw Normal View History

<?php
namespace App\Classes;
class FrameFields
{
private $fields = [];
public function __construct(array $fields)
{
$this->fields = $fields;
}
public function __get($key)
{
return array_get($this->fields,$key);
}
public function output(string $filler)
{
switch ($this->type) {
case 'd':
$out = date('D d M H:ia');
return substr($out.($this->length > strlen($out) ? str_repeat($filler,$this->length-strlen($out)) : ''),0,$this->length);
default:
return str_repeat($filler,$this->length);
}
}
}