このコードを取得しました
$title = new FullName($reservation->Title, $reservation->Description)
ボックス内に Title と Description の値が表示されますが、互いに直接続いています。ボックスが小さすぎる場合、改行が行われますが、ボックスの最後の正確なポイントでのみ行われます。では、どうすれば $reservation->Title と $reservation->Description の間に改行を強制できますか?
フルネームクラスはこちら
class FullName
{
/**
* @var string
*/
private $fullName;
public function __construct($firstName, $lastName)
{
$formatter = Configuration::Instance()->GetKey(ConfigKeys::NAME_FORMAT);
if (empty($formatter))
{
$this->fullName = "$firstName $lastName";
}
else
{
$this->fullName = str_replace('{first}', $firstName, $formatter);
$this->fullName = str_replace('{last}', $lastName, $this->fullName);
}
}
public function __toString()
{
return $this->fullName;
}
}