LoginSignup
1
1

More than 5 years have passed since last update.

postLink()のメッセージ内に変数を使う

Posted at
<?php echo $this->Form->postLink('削除', 
    array('action' => 'delete', $user['user']['id']), 
    array('class' => 'btn btn-sm btn-danger'),
    __('ユーザーID:%1$d %2$sさんを削除しますか?', $user['user']['id'], $user['user']['name']));
?>

$confirmMessageの部分を配列で、PHPのsprintifと似た形式で書ける。
PHP: sprintf - Manual

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1