cakephpの[ $this->Html->link]で[confirm]を指定しているのですが、
「削除してよろしいですか?」と「削除した場合、復元はできません。」の間に改行を入れたいのですが、改行の入れ方が分かりません。
ご教授お願い致します。
問題のコード($idには削除するデータのidが入ります)
php
1echo $this->Html->link( 2 '削除', 3 ['controller' => 'Recipes', 'action' => 'delete', 'id'=>$id], 4 ['confirm' => "削除してよろしいですか?削除した場合、復元はできません。"] 5);
試したこと
php
1echo $this->Html->link( 2 '削除', 3 ['controller' => 'Recipes', 'action' => 'delete', 'id'=>$id], 4 ['confirm' => "削除してよろしいですか?\n削除した場合、復元はできません。"] 5);
↑改行されません
php
1echo $this->Html->link( 2 '削除', 3 ['controller' => 'Recipes', 'action' => 'delete', 'id'=>$id], 4 ['confirm' => "削除してよろしいですか?<br>削除した場合、復元はできません。"] 5);
↑<br>がそのまま出力された
php
1echo $this->Html->link( 2 '削除', 3 ['controller' => 'Recipes', 'action' => 'delete', 'id'=>$id], 4 ['confirm' => "削除してよろしいですか?"."\n"."削除した場合、復元はできません。"] 5);
↑ダイアログが出ずに削除された
php
1echo $this->Html->link( 2 '削除', 3 ['controller' => 'Recipes', 'action' => 'delete', 'id'=>$id], 4 ['confirm' => "削除してよろしいですか?" + "\n" + "削除した場合、復元はできません。"] 5);
↑ダイアログが出ずに削除された
php
1echo $this->Html->link( 2 '削除', 3 ['controller' => 'Recipes', 'action' => 'delete', 'id'=>$id], 4 ['confirm' => "削除してよろしいですか?" + "\n" + "削除した場合、復元はできません。"] 5);
↑ダイアログが出ずに削除された
php
1echo $this->Html->link( 2 '削除', 3 ['controller' => 'Recipes', 'action' => 'delete', 'id'=>$id], 4 ['confirm' => "削除してよろしいですか?" + "\r\n" + "削除した場合、復元はできません。"] 5);
↑ダイアログが出ずに削除された
php
1echo $this->Html->link( 2 '削除', 3 ['controller' => 'Recipes', 'action' => 'delete', 'id'=>$id], 4 ['confirm' => "削除してよろしいですか?" + "<br>" + "削除した場合、復元はできません。"] 5);
↑<br>がそのまま出力された
php
1echo $this->Html->link( 2 '削除', 3 ['controller' => 'Recipes', 'action' => 'delete', 'id'=>$id], 4 ['confirm' => "削除してよろしいですか?" .PHP_EOL."削除した場合、復元はできません。"] 5);
↑ダイアログが出ずに削除された
php
1echo $this->Html->link( 2 '削除', 3 ['controller' => 'Recipes', 'action' => 'delete', 'id'=>$id], 4 ['confirm' => "削除してよろしいですか?" + PHP_EOL + "削除した場合、復元はできません。"] 5);
↑ダイアログが出ずに削除された

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。