本文整理汇总了PHP中Reports::addSlider方法的典型用法代码示例。如果您正苦于以下问题:PHP Reports::addSlider方法的具体用法?PHP Reports::addSlider怎么用?PHP Reports::addSlider使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reports
的用法示例。
在下文中一共展示了Reports::addSlider方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Validate
$pagetitle = "Add a breakdown option";
require_once "../includes/header.php";
if (!$user->hasPermission('tdstaff')) {
Session::flash('error', 'Invalid permissions');
Redirect::to(BASE_URL . 'training');
}
if (Input::exists()) {
//if form submitted!
$validate = new Validate();
$validation = $validate->check($_POST, array('textarea' => array('field_name' => 'Text', 'required' => true), 'program' => array('field_name' => 'Program Name', 'required' => false), 'check' => array('field_name' => 'Slider/Boolean', 'required' => false)));
if ($validation->passed()) {
try {
$r = new Reports();
$check = Input::get('check') ? 1 : 0;
$r->addSlider(array('type' => $check, 'program_id' => Input::get('program'), 'text' => Input::get('textarea')));
Session::flash('success', 'Option added');
Redirect::to('./sliders.php');
} catch (Exception $e) {
die($e->getMessage());
}
} else {
echo '<div class="row">
<div class="col-md-6 col-md-offset-3">
<div class="panel panel-danger">
<div class="panel-heading">
<h3 class="panel-title">The following errors occured:</h3>
</div>
<div class="panel-body">';
foreach ($validation->errors() as $error) {
echo $error . '<br>';