LoginSignup
4
7

More than 5 years have passed since last update.

CakePHP Bootstrap アイコン付きボタン

Posted at

FormHelper::button

<?php echo $this->Form->button(
    '<span class="glyphicon glyphicon-ok" aria-hidden="true"></span>'.__(' 更新'),
    array(
        'type' => 'submit',
        'class' => 'btn btn-primary',
    )
); ?>

FormHelper::postLink
確認ダイアログ付き

<?php echo $this->Form->postLink(
    '<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>'.__(' 削除'),
    array('action' => 'delete', $this->Form->value('PdfList.id')),
    array(
        'escape' => false, 'class' => 'btn btn-danger', 'role' => 'button',
        'confirm' => __('# %s の情報を削除します。よろしいですか?', $this->Form->value('PdfList.id'))
    )
); ?>

HtmlHelper::link

<?php echo $this->Html->link(
    '<span class="glyphicon glyphicon-edit" aria-hidden="true"></span>'.__(' Edit'),
    array('action' => 'edit', $pdfList['PdfList']['id']),
    array('escape' => false, 'class' => 'btn btn-success btn-xs', 'role' => 'button')
); ?>
4
7
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
4
7