簡體   English   中英

Cakephp - 如何在輸出中添加刪除線

[英]Cakephp - how to add strikethrough to output

我有輸出<td><?= h($book->price) ?></td>現在如果$book->sales_price不為null,我想在輸出中添加刪除標記。 我如何添加刪除線的代碼?

if($book->sales_price){
//add strikethrough
}

非常感謝你!

使用刪除標記<s> Sample Text </s><strike> Sample Text </strike>

示范文本

if(is_null($book->sales_price)) {
  <td><?= h($book->price) ?></td>
} else {
  <td><s><?= h($book->price) ?></s></td>
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM