本文整理汇总了PHP中Button::submit方法的典型用法代码示例。如果您正苦于以下问题:PHP Button::submit方法的具体用法?PHP Button::submit怎么用?PHP Button::submit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Button
的用法示例。
在下文中一共展示了Button::submit方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?php
echo BootForm::open(['route' => ['sheets.remove_pilot', 'pilot_id' => $pilot->id, 'id' => $id]]);
echo BootForm::hidden('_action', 'remove_pilot');
echo Button::submit()->withValue('OK')->block();
echo BootForm::close();
示例2:
</h4>
<p>Last login:
<span data-toggle="tooltip" data-placement="top" title="<?php
echo $user->updated_at;
?>
">
<?php
echo Carbon\Carbon::parse($user->updated_at)->diffForHumans();
?>
</span></p>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">Close</button>
<?php
if (!$user->admin) {
echo BootForm::open(['route' => ['admin.promote_user', 'id' => $user->id]]);
echo BootForm::hidden('_action', 'promote_user');
echo Button::submit()->success()->withValue('Promote');
echo BootForm::close();
} else {
echo BootForm::open(['route' => ['admin.demote_user', 'id' => $user->id]]);
echo BootForm::hidden('_action', 'demote_user');
echo Button::submit()->danger()->withValue('Demote');
echo BootForm::close();
}
?>
</div>
</div><!-- /.modal-content -->
示例3: function
return Button::link(URL::route($resourceName . '.create'), $buttonValue);
}
});
// Show "Edit" button for a specific resource
HTML::macro('resourceUpdate', function ($resourceName, $resourceItem, $buttonValue) {
$resourceItemId = is_object($resourceItem) ? $resourceItem->id : $resourceItem;
if (Authority::can('update', $resourceName, $resourceItem)) {
return Button::link(URL::route($resourceName . '.edit', array($resourceName => $resourceItemId)), $buttonValue);
}
});
// Show "Delete" button for a specific resource
HTML::macro('resourceDelete', function ($resourceName, $resourceItem, $buttonValue) {
$resourceItemId = is_object($resourceItem) ? $resourceItem->id : $resourceItem;
if (Authority::can('delete', $resourceName, $resourceItem)) {
$output = Form::open(array('route' => array($resourceName . '.destroy', $resourceItemId), 'method' => 'DELETE', 'data-confirm' => 'Are you sure?', 'class' => 'resource-destroy'));
$output .= Button::submit($buttonValue, array('title' => 'Delete ' . $resourceName));
$output .= Form::close();
return $output;
}
});
// Show user avatar with status info
HTML::macro('userAvatar', function ($user, $size = 'small', $classes = array()) {
if (!is_array($classes)) {
$classes = array($classes);
}
$classes[] = 'avatar';
$classes[] = 'avatar-' . $size;
$state = $user->states()->latest()->first();
if (count($state)) {
if (isset($state->application_id)) {
$classes[] = 'in-game';
示例4: submit
/**
* Submits data to the button.
*
* @param null|string $submittedData The data.
* @param bool $clearMissing Not used.
*
* @return SubmitButton The button instance
*
* @throws Exception\AlreadySubmittedException If the form has already been submitted.
*/
public function submit($submittedData, $clearMissing = true)
{
parent::submit($submittedData, $clearMissing);
$this->clicked = null !== $submittedData;
return $this;
}
示例5: number_format
<?php
echo BootForm::open(['route' => ['sheets.mark_as_paid', $site->id]]);
echo BootForm::hidden('_action', 'mark_as_paid');
echo BootForm::text('payout', 'Corp Cut', number_format($site->sheet->corp_cut, 2, '.', ''), ['readonly']);
echo Button::submit()->withValue('Mark as Paid')->block();
echo BootForm::close();