2016-07-02 3 views
1

출력이 <td><?= h($book->price) ?></td>인데 $book->sales_price이 null이 아닌 경우 출력에 취소 선 태그를 추가하고 싶습니다. 취소 선 코드를 어떻게 추가합니까?Cakephp - 출력에 취소 선을 추가하는 방법

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

대단히 감사합니다.

답변

0

태그 <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> 
} 
를 통해 파업을 사용하여
관련 문제