据我了解,
use cases或interactors用于entities执行某些操作,而,entities持有我们的business rules.
根据这个定义:
用例与实体交互并依赖于实体
用例以什么方式依赖于实体,关系是什么?
例如,假设我们有一个具有三个功能的银行应用程序:login、view balance和transfer funds。
因此,为了能够转移资金,用户必须登录并且应该有足够的余额。
我猜我们这里的用例是,transfer funds上面的语句是business rule,如果是这样的话,如何实现它?
类比很多,但正确的实现却很少。
我正在使用 html 创建 pdf。下面是我的代码:
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetMargins(15, 20, 14, 0);
$pdf->SetAutoPageBreak(TRUE, 0);
$pdf->setCellPaddings(0,0,0,0);
$pdf->setFooterMargin(0);
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
// add a page
$pdf->AddPage();
$html = '
<div style="background-color: #f8f8f8;">
<div style="font-size: 24px; color: #333; font-weight: 600; font-family:Arial,Helvetica,sans-serif;">Example</div>
<p style="color: #828282; font-size: 14px; font-family: sans-serif;">Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry standard dummy text ever since the 1500s,
when an unknown printer took a galley …Run Code Online (Sandbox Code Playgroud)