本文整理汇总了PHP中bootstrap类的典型用法代码示例。如果您正苦于以下问题:PHP bootstrap类的具体用法?PHP bootstrap怎么用?PHP bootstrap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了bootstrap类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: assignAction
function assignAction()
{
$user = \bootstrap::getInstance()->getUser();
if (!$user['id'] || $user['type'] != 'admin') {
return $this->_redirect('/');
}
$staff_id = $this->params('staff');
$staff = $this->userDataMapper()->find(array('id' => $staff_id));
$form = $this->servicesForm();
if ($this->getRequest()->isPost() && $form->isValid($this->params()->fromPost())) {
$this->userDataMapper()->unassignServices($staff_id);
$this->userDataMapper()->assignMultiple($form->getValue('services'), $staff_id);
$this->flashMessenger()->addMessage('Staff\'s Services Updated');
if (isset($_SESSION['admin_setup'])) {
return $this->redirect()->toRoute('staff-availability', ['staff' => $user['id']]);
}
return $this->redirect()->toRoute('manage-staff');
}
$this->viewParams['staff'] = $staff;
$this->viewParams['form'] = $form;
if (isset($_SESSION['admin_setup'])) {
$this->viewParams['admin_setup'] = 1;
}
return $this->viewParams;
}
开发者ID:mustafakarali,项目名称:application,代码行数:25,代码来源:ServicesController.php
示例2: indexAction
function indexAction()
{
$this->init();
$layoutViewModel = $this->layout();
$progress = new ViewModel(['step' => 2]);
$progress->setTemplate('application/progress');
$layoutViewModel->addChild($progress, 'progress');
$user = \bootstrap::getInstance()->getUser();
$staffSelector = $this->staffSelector(true, $this->params('service'));
if (!is_null($staffSelector->getValue('staff'))) {
$this->staff_selection = $staffSelector->getValue('staff');
} else {
$this->staff_selection = $this->listStaff($this->params()->fromQuery('service'));
}
$this->viewParams = $this->viewParams + ['staffSelector' => $staffSelector, 'therapist_id' => $this->params()->fromQuery('staff'), 'service' => $this->params('service')];
$this->renderCalendar($this->viewParams);
/** Display controls to toggle between week & calendar views */
$this->viewParams['mode'] = $this->params('mode');
$viewModel = new ViewModel($this->viewParams);
$viewModel->setTemplate('application/calendar-mode-chooser');
//return $viewModel;
$viewModel = new ViewModel($this->viewParams);
if ($this->params('mode') == 'week') {
/** Display the week view */
$viewModel->setTemplate('week-choose');
} else {
/** Display the calendar */
$viewModel->setTemplate('application/calendar-choose');
}
return $viewModel;
}
开发者ID:mustafakarali,项目名称:application,代码行数:31,代码来源:CalendarController.php
示例3: setUp
protected function setUp()
{
parent::setUp();
bootstrap::init_imap();
bootstrap::purge_mailbox('INBOX');
// import email messages
foreach (glob(TESTS_DIR . 'Selenium/data/mail/list_*.eml') as $f) {
bootstrap::import_message($f, 'INBOX');
$this->msgcount++;
}
}
开发者ID:JotapePinheiro,项目名称:roundcubemail,代码行数:11,代码来源:Getunread.php
示例4: __construct
public function __construct($view, $model, $lang, $conf)
{
\bootstrap::iniControllerParams($this, $view);
if (request::isGet() && $model->validateBefore()) {
$pages = new pdo\select('page');
$pages->setColumns(array('page.id', 'page.sequence', 'page.uri', 'page.label', 'page.title', 'page.heading', 'page.description', 'page.content', 'page.icon', 'page.dateCreated', 'page.dateUpdated', 'page.isActive', 'p.id AS parentPageId', 'p.uri AS uriParent', 'p.label AS parentPageTitle'))->addJoin('p', 'id', 'parentId', 'LEFT', true, 'page')->addWhere('page.id', '=', request::get('id'))->execute('fetch');
$view->editData = $pages->data;
}
$page = new pdo\select('page');
$page->setColumns(array('*'))->addWhere('parentId', '=', 0)->addWhere('isActive', '=', 1)->addWhere('uri', '!=', 'about')->orderBy('page.sequence', 'asc')->count()->execute();
$view->navItems = $page->data;
$page = new pdo\select('page');
$page->setColumns(array('
page.id,
page.uri,
page.label,
page.title,
page.description,
page.content'))->addJoin('page_role', 'pageId', 'id', 'RIGHT')->addWhere('uri', '=', 'add')->addWhere('page_role.roleId', '=', session::get('roleId'))->execute('fetch');
$view->page = $page->data;
$page = new pdo\select('page');
$page->setColumns(array('
id,
label'))->orderBy('sequence', 'asc')->execute()->asList('id', 'label');
$view->lookupPageParent = $page->data;
if (request::isPost()) {
if ($model->validateAfter()) {
$data = array('parentId' => request::get('parentId'), 'sequence' => request::get('sequence'), 'uri' => request::get('uri'), 'label' => request::get('label'), 'title' => request::get('title'), 'heading' => request::get('heading'), 'description' => request::get('description'), 'icon' => request::get('icon'), 'content' => request::get('content'), 'dateUpdated' => date('Y-m-d H:i:s'));
$page = new pdo\insert('page');
$page->setColumns(array_keys($data))->setValues(array_values($data))->execute();
$view->data = $data;
} else {
$view->errors = $model->getErrors();
}
}
$navSub = new pdo\select('page');
$navSub->setColumns(array('
page.id,
page.uri,
page.label,
page.title,
page.icon,
page.description,
page.content,
p.id AS parentPageId,
p.uri AS uriParent,
p.label AS parentPageTitle'))->addJoin('p', 'id', 'parentId', 'LEFT', true, 'page')->addJoin('page_role', 'pageId', 'id', 'RIGHT')->addWhere('page_role.isNav', '=', 1)->addWhere('page_role.roleId', '=', session::get('roleId'))->orderBy('page.sequence', 'asc')->execute();
// echo '<pre>';
//print_r($navSub->data);
//die('kj');
$view->navSub = $navSub->data;
}
开发者ID:dnerezov,项目名称:paper-boot-dev-pad,代码行数:52,代码来源:add.php
示例5: init
function init()
{
$user = \bootstrap::getInstance()->getUser();
if ($this->requestedCalendarOutOfRange()) {
$this->viewParams['limitMonths'] = $this->limitMonths;
$viewModel->setTemplate('limited', null, true);
$month = date('m');
$year = date('Y');
} else {
$month = $this->month();
$year = $this->year();
}
$this->number_of_days_in_month = cal_days_in_month(CAL_GREGORIAN, $month, $year);
$this->viewParams['year'] = $year;
$this->viewParams['month'] = $month;
$this->viewParams['month_name'] = date('F', strtotime('1-' . $month . '-' . $year));
$this->viewParams['number_of_days_in_month'] = $this->number_of_days_in_month;
}
开发者ID:mustafakarali,项目名称:application,代码行数:18,代码来源:AbstractCalendarController.php
示例6: signed_in
public static function signed_in($user, $loginfailures, $mnet, $real, $role_switch, $logout)
{
$links[] = bootstrap::li_icon_link($user['link'], 'user', 'Profile');
if ($mnet !== null) {
$links[] = bootstrap::li_icon_link($mnet['link'], 'globe', $mnet['name']);
}
if (isset($loginfailures)) {
$links[] = bootstrap::li_icon_link($loginfailures['link'], 'warning-sign', $loginfailures['name']);
$user['name'] .= ' ' . bootstrap::icon('warning-sign');
}
if ($role_switch !== null) {
$links[] = bootstrap::li_icon_link($role_switch['link'], 'repeat', $role_switch['name']);
}
if ($real !== null) {
$links[] = bootstrap::li_icon_link($real['link'], 'user', $real['name']);
}
$links[] = bootstrap::list_divider();
$links[] = bootstrap::li_icon_link($logout['link'], 'off', $logout['name']);
return html::ul('nav pull-right', bootstrap::dropdown_menu($user['name'], $links));
}
开发者ID:rbclark,项目名称:moodle-theme_bootstrap_renderers,代码行数:20,代码来源:bootsnipp.php
示例7: cancelAction
function cancelAction()
{
$user = \bootstrap::getInstance()->getUser();
if (!$user['id']) {
return $this->_redirect('/');
}
$db = \Zend_Registry::get('db');
$newValues = array('canceled' => 1);
$condition = 'id=' . (int) $this->params('id');
$appointment_date = $db->select()->from('appointments', array('date'))->where('id=?', $this->params('id'))->query()->fetchColumn();
if ($user['type'] == 'client') {
$booking = new Booking(array('today' => date('Y-m-d'), 'date' => $appointment_date));
if (!$booking->allowCancelByUser()) {
echo 'not allowed to cancel';
exit;
}
$condition .= ' && user_id = ' . (int) $user['id'];
} else {
if ($user['type'] == 'staff') {
$condition .= ' && staff_userid = ' . (int) $user['id'];
} else {
if ($user['type'] !== 'admin') {
return $this->_redirect('/');
}
}
}
$db->update('appointments', $newValues, $condition);
$logMessage = 'Therapist appointment #' . (int) $this->params('id');
$logMessage .= ' cancelled by user #' . $user['id'];
$this->cancelsLogger()->log($logMessage, Zend_Log::INFO);
$this->viewParams['date'] = $appointment_date;
$viewModel = new ViewModel($this->viewParams);
$viewModel->setTemplate('appointments/cancel.phtml');
$htmlOutput = $this->getServiceLocator()->get('viewrenderer')->render($viewModel);
$mail = new Zend_Mail();
$mail->addTo($user['email']);
$mail->setBodyText($htmlOutput);
$this->queueMail($mail);
echo $htmlOutput;
$this->_helper->viewRenderer->setNoRender(true);
}
开发者ID:mustafakarali,项目名称:application,代码行数:41,代码来源:AppointmentsController.php
示例8: indexAction
function indexAction()
{
$user = \bootstrap::getInstance()->getUser();
if (!$user['id'] || $user['type'] != 'staff' && $user['type'] != 'admin') {
return $this->_redirect('/');
}
if ($user['type'] == 'admin' && !$this->params('staff')) {
throw new Exception('Admin must have a staff selected');
}
$this->viewParams['availability'] = array();
for ($day = 1; $day <= 7; $day++) {
$staff = $user['type'] == 'admin' ? $this->params('staff') : $user['id'];
$this->viewParams['availability'][$day] = $this->selectAvailability($day, null, $staff);
}
$db = \Zend_Registry::get('db');
if ($this->params()->fromQuery('remove')) {
$db->delete('availability', array('id = ' . (int) $this->params()->fromQuery('remove')));
$this->flashMessenger()->addMessage('Deleted Availability');
return $this->redirect()->toUrl($this->url()->fromRoute('staff-availability', array(), true));
}
$form = new \Application\AvailabilityForm();
if ($this->getRequest()->isPost() && $form->isValid($this->params()->fromPost())) {
$staff_userid = $user['type'] == 'admin' ? $this->params('staff') : $user['id'];
$parameters = array('staff_userid' => $staff_userid, 'day_of_week' => $form->getValue('day'), 'start' => $form->getValue('start'), 'end' => $form->getValue('end'));
$this->availabilityDataMapper()->insert($parameters);
$this->flashMessenger()->addMessage('Added Availability');
if (isset($_SESSION['admin_setup'])) {
return $this->redirect()->toRoute('home');
}
return $this->redirect()->toUrl($this->url()->fromRoute('staff-availability', array(), true));
}
$this->viewParams['form'] = $form;
if (isset($_SESSION['admin_setup'])) {
$this->viewParams['admin_setup'] = 1;
}
$viewModel = new ViewModel($this->viewParams);
$viewModel->setTemplate('application/availability-manage.phtml');
return $viewModel;
}
开发者ID:mustafakarali,项目名称:application,代码行数:39,代码来源:AvailabilityController.php
示例9:
<?php
/**
* Created by PhpStorm.
* User: csibi
* Date: 2015.07.13.
* Time: 11:24
*/
$url = \bootstrap::get("url");
?>
<form method="post" id="client-form" role="form">
<?php
echo form::input("id");
?>
<div class="row">
<div class="col-md-4">
<div class="row">
<div class="col-md-12">
<?php
echo form::input("label");
?>
</div>
<div class="col-md-12">
<?php
echo form::input("category");
?>
</div>
</div>
<div class="row">
<div class="col-md-12">
<?php
开发者ID:RetroscopeCreative,项目名称:RouterunnerCMS,代码行数:31,代码来源:campaign.frm.form.php
示例10: array
UPDATE `{PREFIX}model_metas` SET `keywords` = :keywords WHERE `reference` = :reference
SQL;
$params_meta = array(":reference" => $model->reference, ":keywords" => strip_tags($keywords));
\db::query($SQL_meta, $params_meta);
}
}
// save description
if (isset($field_context["is_description"]) && $field_context["is_description"]) {
$SQL_meta = 'SELECT model_meta_id, description ';
$SQL_meta .= 'FROM `{PREFIX}model_metas` ';
$SQL_meta .= 'WHERE `reference` = :reference';
$params_meta = array(":reference" => $model->reference);
$result_meta = \db::query($SQL_meta, $params_meta);
$description = '';
$prefixes = \bootstrap::get("pageproperties_prefix");
if ($prefixes && isset($prefixes["description"])) {
$description .= $prefixes["description"];
}
$description .= $value;
if (!$result_meta) {
$SQL_meta = <<<SQL
INSERT INTO `{PREFIX}model_metas` (`reference`, `description`) VALUES (:reference, :description)
SQL;
$params_meta = array(":reference" => $model->reference, ":description" => preg_replace("/\\t/im", "", preg_replace("/\\n\\n/im", "\n", strip_tags($description))));
\db::insert($SQL_meta, $params_meta);
} elseif (is_null($result_meta[0]["description"]) || isset($field_context["force_description"]) && $field_context["force_description"]) {
$SQL_meta = <<<SQL
UPDATE `{PREFIX}model_metas` SET `description` = :description WHERE `reference` = :reference
开发者ID:RetroscopeCreative,项目名称:RouterunnerCMS,代码行数:30,代码来源:apply_change.php
示例11: array
} else {
$where = array('id IN (' . implode(",", $children) . ')' => null);
}
\runner::route($page, $where);
}
} elseif ($resource_uri == "unsubscribe/success") {
echo ' <div class="row">' . PHP_EOL;
echo ' <div class="col-md-12">' . PHP_EOL;
echo ' <h1>Ön sikeresen leiratkozott leveleinkről!<br> Elnézését kérjük a zavarásért, ' . 'a jövőben erre a címre nem fog tőlünk kapni e-mailt!</h1>' . PHP_EOL;
echo ' </div>' . PHP_EOL;
echo ' </div>' . PHP_EOL;
} elseif ($resource_uri == "unsubscribe/error" || strpos($resource_uri, "unsubscribe/") !== false) {
echo ' <div class="row">' . PHP_EOL;
echo ' <div class="col-md-12">' . PHP_EOL;
echo ' <h1><h1>Hiba történt a leiratkozás során!<br>Kérjük írjon a ' . '<a href="mailto:[email protected]" target="_blank">[email protected]</a> címre' . ' és kollégánk rögtön törölni fogja e-mail címét!<br>Elnézését kérjük a zavarásért!</h1>' . PHP_EOL;
echo ' </div>' . PHP_EOL;
echo ' </div>' . PHP_EOL;
} elseif ($current && isset($current["menu"]) && $current["menu"] === "1") {
\runner::route("home");
} elseif (isset($current) && is_array($current) && count($current) === 0 && !\bootstrap::get("url")) {
\runner::route("home");
} else {
echo ' <div class="row">' . PHP_EOL;
echo ' <div class="col-md-12">' . PHP_EOL;
\runner::route("error404");
echo ' </div>' . PHP_EOL;
echo ' </div>' . PHP_EOL;
}
?>
</div>
开发者ID:RetroscopeCreative,项目名称:RouterunnerDemo,代码行数:30,代码来源:contents.view.php
示例12:
<div class="col-lg-12">
' . lang::get('idea_text') . '
<hr />
</div>
<div class="col-md-9">
<textarea class="form-control"></textarea>
</div>
<div class="col-md-3">
<p><button class="btn btn-default">' . lang::get('send') . '</button></p>
<div id="ajax-content"></div>
</div>
</div>
', ['id' => 'idea', 'col' => 'lg-6']);
?>
</div>
<div class="expand">
<i class="fa fa-chevron-up"></i>
</div>
</section>
<div class="row">
<?php
$button = '<a href="http://dynao.de" target="_blank" class="btn btn-sm btn-default">' . lang::get('all_addons') . '</a>';
echo bootstrap::panel(lang::get('addons'), [$button], dyn::getAddons(), ['table' => true, 'col' => 'lg-6']);
$button = '<a href="http://dynao.de" target="_blank" class="btn btn-sm btn-default">' . lang::get('all_modules') . '</a>';
echo bootstrap::panel(lang::get('modules'), [$button], dyn::getModules(), ['table' => true, 'col' => 'lg-6']);
?>
</div>
<?php
echo extension::get('DASHBOARD_OVERVIEW', '');
开发者ID:pasterntt,项目名称:dynao-CMS,代码行数:31,代码来源:dashboard.overview.php
示例13: isset
<?php
/**
* Created by PhpStorm.
* User: csibi
* Date: 2015.07.13.
* Time: 11:11
*/
$bootstrap = \bootstrap::get();
$params = $bootstrap->params;
$search = isset($_GET["search"]) ? $_GET["search"] : "";
\runner::route("/backend/pages/user/memberform", array("profile" => \user::me()));
开发者ID:RetroscopeCreative,项目名称:RouterunnerCMS,代码行数:12,代码来源:profile.view.php
示例14: getInstance
public static function getInstance()
{
if (null === self::$_instance) {
self::$_instance = new self();
}
return self::$_instance;
}
开发者ID:mustafakarali,项目名称:application,代码行数:7,代码来源:bootstrap.php
示例15: start
public static function start()
{
# load config
$config = (include __DIR__ . '/settings.php');
self::$config = $config;
self::loadClasses();
# bind array $config ke class Connection
Connection::setConfig(self::$config['db']);
# make a route
$router = new Route(self::$config);
# match the current request
$match = $router->getRoute()->match();
if ($match && is_callable($match['target'])) {
call_user_func_array($match['target'], $match['params']);
} else {
# no route was matched
header($_SERVER["SERVER_PROTOCOL"] . ' 404 Not Found');
echo "<h3>No Route was matched with</h3>";
echo "<table>";
echo "<tr>";
echo "<th>Method</th>";
echo "<th>Route</th>";
echo "</tr>";
// echo "<td>Controller</td>";
foreach ($router->getRoute()->getRoutes() as $route) {
print "<tr>";
print "<td> {$route['0']} </td>";
print "<td> {$route['1']} </td>";
print "<tr>";
}
echo "</table>";
}
}
开发者ID:OckiFals,项目名称:iniforum,代码行数:33,代码来源:bootstrap.php
示例16: utilisateursController
function utilisateursController(&$command, $config, $app)
{
parent::__construct($command, $config, $app);
$this->catchAll = true;
// Controle d'acces � la rubrique
$this->users->checkAccess('configuration');
// Activation du menu
$this->menu_admin = 'configuration';
}
开发者ID:bilel99,项目名称:oge,代码行数:9,代码来源:utilisateurs.php
示例17: statsController
function statsController(&$command, $config, $app)
{
parent::__construct($command, $config, $app);
$this->catchAll = true;
// Controle d'acces ŕ la rubrique
$this->users->checkAccess('stats');
// Activation du menu
$this->menu_admin = 'stats';
}
开发者ID:bilel99,项目名称:oge,代码行数:9,代码来源:stats.php
示例18: thickboxController
function thickboxController(&$command, $config, $app)
{
parent::__construct($command, $config, $app);
$this->catchAll = true;
// On masque les Head, header et footer originaux plus le debug
$this->autoFireHeader = false;
$this->autoFireHead = false;
$this->autoFireFooter = false;
$this->autoFireDebug = false;
}
开发者ID:bilel99,项目名称:oge,代码行数:10,代码来源:thickbox.php
示例19: __construct
/**
* 构造函数
*/
public function __construct($re)
{
if (!is_file(Wind::getRealPath('DATA:install.lock', true))) {
Wind::getComponent('response')->sendRedirect("install.php");
}
parent::__construct($re);
//云应用监听sql执行
WindFactory::_getInstance()->loadClassDefinitions(array('sqlStatement' => array('proxy' => 'WIND:filter.proxy.WindEnhancedClassProxy', 'listeners' => array('LIB:compile.acloud.PwAcloudDbListener'))));
$this->charset = Wind::getComponent('response')->getCharset();
}
开发者ID:ccq18,项目名称:EduSoho,代码行数:13,代码来源:phpwindBoot.php
示例20: protectedController
function protectedController(&$command, $config, $app)
{
parent::__construct($command, $config, $app);
$this->autoFireHeader = false;
$this->autoFireHead = false;
$this->autoFireView = false;
$this->autoFireFooter = false;
$this->autoFireDebug = false;
$this->catchAll = true;
}
开发者ID:bilel99,项目名称:oge,代码行数:10,代码来源:protected.php
注:本文中的bootstrap类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论