Example #1
0
function fmt($fs)
{
    $s = new FormattedText(false);
    $args = func_get_args();
    $args[0] = _($args[0]);
    $s->_init($args);
    return $s;
}
 /**
  * Overrides the TextContainer::isValid().
  *
  * @see TextContainer::isValid().
  * @return true for valid Caption when it is filled, false otherwise.
  */
 public function isValid()
 {
     return parent::isValid() || $this->title && $this->title->isValid();
 }
 /**
  * Adds content to the formatted text.
  *
  * @param string|FormattedText|TextContainer The content can be a string or a FormattedText.
  *
  * @return $this
  */
 public function appendText($child)
 {
     Type::enforce($child, [Type::STRING, FormattedText::getClassName(), TextContainer::getClassName()]);
     $this->textChildren[] = $child;
     return $this;
 }