• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP get_request_method函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_request_method函数的典型用法代码示例。如果您正苦于以下问题:PHP get_request_method函数的具体用法?PHP get_request_method怎么用?PHP get_request_method使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_request_method函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: forgot

 function forgot()
 {
     if (get_request_method() == 'POST') {
         return $this->_sendPasswordTo($_POST['forgot']['email']);
     }
     $this->display('login/forgot', array('email' => Flash::get('email')));
 }
开发者ID:albertobraschi,项目名称:toad,代码行数:7,代码来源:LoginController.php


示例2: settings

 public function settings()
 {
     $errors = false;
     if (get_request_method() == 'POST') {
         $data = $_POST['settings'];
         $settings = array();
         $settings['filemanager_base'] = preg_replace('/\\s+/', '', $data['filemanager_base']);
         $settings['filemanager_base'] = trim($settings['filemanager_base'], '/');
         $settings['filemanager_view'] = isset($data['filemanager_view']) ? $data['filemanager_view'] : 'grid';
         // image extensions
         if (isset($data['filemanager_images'])) {
             $settings['filemanager_images'] = serialize($data['filemanager_images']);
         } else {
             $errors[] = __("You need to select at least one image extension!");
         }
         $settings['filemanager_upload_size'] = !empty($data['filemanager_upload_size']) && is_numeric($data['filemanager_upload_size']) ? $data['filemanager_upload_size'] : '0';
         $settings['filemanager_dateformat'] = !empty($data['filemanager_dateformat']) ? trim($data['filemanager_dateformat']) : 'd M Y H:i';
         $booleans = array('filemanager_enabled', 'filemanager_browse_only', 'filemanager_upload_overwrite', 'filemanager_upload_images_only');
         foreach ($booleans as $bool) {
             $settings[$bool] = isset($data[$bool]) && $data[$bool] == 1 ? '1' : '0';
         }
         if (Plugin::setAllSettings($settings, 'ckeditor')) {
             Flash::setNow('success', 'Settings were updated successfully');
         } else {
             $errors[] = __("There was a problem saving the settings.");
         }
     } else {
         $settings = Plugin::getAllSettings('ckeditor');
     }
     if ($errors !== false) {
         Flash::setNow('error', implode('<br/>', $errors));
     }
     $this->display('settings', array('settings' => $settings));
 }
开发者ID:sindotnet,项目名称:dashhotel,代码行数:34,代码来源:CkeditorController.php


示例3: __construct

 public function __construct()
 {
     parent::__construct();
     if (get_request_method() != 'AJAX') {
         die('error request');
     }
 }
开发者ID:chaobj001,项目名称:tt,代码行数:7,代码来源:ajax_post.php


示例4: index

 function index()
 {
     // check if trying to save
     if (get_request_method() == 'POST') {
         return $this->_save();
     }
     $this->display('setting/index');
 }
开发者ID:albertobraschi,项目名称:toad,代码行数:8,代码来源:SettingController.php


示例5: index

 /**
  * Calls save function or displays settings screen.
  */
 public final function index()
 {
     // check if trying to save
     if (get_request_method() == 'POST') {
         $this->_save();
     }
     $this->display('setting/index', array('csrf_token' => SecureToken::generateToken(BASE_URL . 'setting')));
 }
开发者ID:sindotnet,项目名称:cona,代码行数:11,代码来源:SettingController.php


示例6: edit

 function edit($id)
 {
     if (!($snippet = Snippet::findById($id))) {
         Flash::set('error', __('Snippet not found!'));
         redirect(get_url('snippet'));
     }
     // check if trying to save
     if (get_request_method() == 'POST') {
         return $this->_edit($id);
     }
     $this->display('snippet/edit', array('action' => 'edit', 'filters' => Filter::findAll(), 'snippet' => $snippet));
 }
开发者ID:albertobraschi,项目名称:toad,代码行数:12,代码来源:SnippetController.php


示例7: edit

 public function edit($id)
 {
     if (!($gallery = Gallery::findById($id))) {
         Flash::set('error', __('Image is not found!'));
         redirect(get_url('gallery'));
     }
     // check if trying to save
     if (get_request_method() == 'POST') {
         return $this->_edit($id);
     }
     $this->display('gallery/view', array('gallery' => $gallery));
 }
开发者ID:sindotnet,项目名称:canareef,代码行数:12,代码来源:GalleryController.php


示例8: edit

 function edit($id)
 {
     if (!($layout = Layout::findById($id))) {
         Flash::set('error', __('Layout not found!'));
         redirect(get_url('layout'));
     }
     // check if trying to save
     if (get_request_method() == 'POST') {
         return $this->_edit($id);
     }
     // display things...
     $this->display('layout/edit', array('action' => 'edit', 'layout' => $layout));
 }
开发者ID:albertobraschi,项目名称:toad,代码行数:13,代码来源:LayoutController.php


示例9: edit

 function edit($id = null)
 {
     if (is_null($id)) {
         redirect(get_url('plugin/comment'));
     }
     if (!($comment = Comment::findById($id))) {
         Flash::set('error', __('comment not found!'));
         redirect(get_url('plugin/comment'));
     }
     // check if trying to save
     if (get_request_method() == 'POST') {
         return $this->_edit($id);
     }
     // display things...
     $this->display('comment/views/edit', array('action' => 'edit', 'comment' => $comment));
 }
开发者ID:crick-ru,项目名称:wolfcms,代码行数:16,代码来源:CommentController.php


示例10: edit

 function edit($id)
 {
     if (AuthUser::getId() != $id && !AuthUser::hasPermission('administrator')) {
         Flash::set('error', __('You do not have permission to access the requested page!'));
         redirect(get_url());
     }
     // check if trying to save
     if (get_request_method() == 'POST') {
         return $this->_edit($id);
     }
     if ($user = User::findById($id)) {
         $this->display('user/edit', array('action' => 'edit', 'user' => $user, 'permissions' => Record::findAllFrom('Permission')));
     } else {
         Flash::set('error', __('User not found!'));
     }
     redirect(get_url('user'));
 }
开发者ID:albertobraschi,项目名称:toad,代码行数:17,代码来源:UserController.php


示例11: _send_headers

 private function _send_headers()
 {
     header('Cache-Control: no-store, no-cache, must-revalidate');
     header('Cache-Control: post-check=0, pre-check=0', FALSE);
     header('Pragma: no-cache');
     header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
     if (get_request_method() == 'AJAX') {
         //if( $this->param('ajaxtp') == 'xml' ) {
         //  header('Content-type: application/xml; charset=utf-8');
         //}
         //else {
         header('Content-type: text/plain; charset=utf-8');
         //}
     } else {
         header('Content-type: text/html; charset=utf-8');
     }
 }
开发者ID:chaobj001,项目名称:tt,代码行数:17,代码来源:class_page.php


示例12: edit

 /**
  * Saves the edited Snippet.
  *
  * @todo Merge _edit() and edit()
  *
  * @param string $id Snippet id.
  */
 public function edit($id)
 {
     // check if user have already enter something
     $snippet = Flash::get('post_data');
     if (empty($snippet)) {
         $snippet = Snippet::findById($id);
         if (!$snippet) {
             Flash::set('error', __('Snippet not found!'));
             redirect(get_url('snippet'));
         }
     }
     // check if trying to save
     if (get_request_method() == 'POST') {
         $this->_edit($id);
     }
     $this->display('snippet/edit', array('action' => 'edit', 'csrf_token' => SecureToken::generateToken(BASE_URL . 'snippet/edit'), 'filters' => Filter::findAll(), 'snippet' => $snippet));
 }
开发者ID:sindotnet,项目名称:cona,代码行数:24,代码来源:SnippetController.php


示例13: collection_update

 public function collection_update($id = null)
 {
     if (is_null($id)) {
         redirect(get_url('plugin/ecommerce/collection'));
     }
     if (!($collection = Collection::findById($id))) {
         Flash::set('error', __('Collection not found!'));
         redirect(get_url('plugin/ecommerce/collection'));
     }
     if (get_request_method() == 'POST') {
         $collection_id = $this->_collection_save($id, 'collection', 'Collection');
         //insert log
         $this->_insert_log('Collection <a href="' . get_url('plugin/ecommerce/collection_update/' . $collection_id) . '">' . $_POST['collection']['title'] . '</a> was updated.');
         redirect(get_url('plugin/ecommerce/collection'));
     }
     //get products
     global $__FROG_CONN__;
     $sql = 'select pc.id, pc.collection_id, pc.product_id, p.title, pc.position from ecommerce_collection c inner join ecommerce_product_collection pc on c.id = pc.collection_id inner join ecommerce_product p on p.id = pc.product_id where c.id = ' . $id . ' order by pc.position;';
     $stmt = $__FROG_CONN__->prepare($sql);
     $stmt->execute();
     $products = $stmt->fetchAll();
     $this->display('ecommerce/views/collections/update', array('action' => 'update', 'collection' => $collection, 'products' => $products));
 }
开发者ID:shuhrat,项目名称:frog_ecommerce,代码行数:23,代码来源:EcommerceController.php


示例14: add

 public function add()
 {
     // check if trying to save
     if (get_request_method() == 'POST') {
         return $this->_add();
     }
     // check if user have already enter something
     $sidebarlink = Flash::get('post_data');
     if (empty($sidebarlink)) {
         $sidebarlink = new SidebarLink();
     }
     $this->browse();
 }
开发者ID:sindotnet,项目名称:cona,代码行数:13,代码来源:SidebarlinkController.php


示例15: _check

 private function _check($permission = NULL)
 {
     global $pawUsers;
     if (!$pawUsers->isLoggedIn()) {
         $this->_redirect(get_url("login"));
     }
     if ($permission !== NULL && !$pawUsers->permissions->hasPermission($permission)) {
         Flash::set("error", __("You don't have the Permission to access the requested page!"));
         if (Setting::get("default_tab") === "user") {
             $this->_redirect(get_url("page"));
         } else {
             $this->_redirect();
         }
     }
     return get_request_method();
 }
开发者ID:pawedWolf,项目名称:wolfcms-pawusers,代码行数:16,代码来源:controller.user.php


示例16: framework_exception_handler

/**
 * Provides a nice print out of the stack trace when an exception is thrown.
 *
 * @param Exception $e Exception object.
 */
function framework_exception_handler($e)
{
    if (!DEBUG) {
        page_not_found();
    }
    echo '<style>h1,h2,h3,p,td {font-family:Verdana; font-weight:lighter;}</style>';
    echo '<p>Uncaught ' . get_class($e) . '</p>';
    echo '<h1>' . $e->getMessage() . '</h1>';
    $traces = $e->getTrace();
    if (count($traces) > 1) {
        echo '<p><b>Trace in execution order:</b></p>' . '<pre style="font-family:Verdana; line-height: 20px">';
        $level = 0;
        foreach (array_reverse($traces) as $trace) {
            ++$level;
            if (isset($trace['class'])) {
                echo $trace['class'] . '&rarr;';
            }
            $args = array();
            if (!empty($trace['args'])) {
                foreach ($trace['args'] as $arg) {
                    if (is_null($arg)) {
                        $args[] = 'null';
                    } else {
                        if (is_array($arg)) {
                            $args[] = 'array[' . sizeof($arg) . ']';
                        } else {
                            if (is_object($arg)) {
                                $args[] = get_class($arg) . ' Object';
                            } else {
                                if (is_bool($arg)) {
                                    $args[] = $arg ? 'true' : 'false';
                                } else {
                                    if (is_int($arg)) {
                                        $args[] = $arg;
                                    } else {
                                        $arg = htmlspecialchars(substr($arg, 0, 64));
                                        if (strlen($arg) >= 64) {
                                            $arg .= '...';
                                        }
                                        $args[] = "'" . $arg . "'";
                                    }
                                }
                            }
                        }
                    }
                }
            }
            echo '<b>' . $trace['function'] . '</b>(' . implode(', ', $args) . ')  ';
            echo 'on line <code>' . (isset($trace['line']) ? $trace['line'] : 'unknown') . '</code> ';
            echo 'in <code>' . (isset($trace['file']) ? $trace['file'] : 'unknown') . "</code>\n";
            echo str_repeat("   ", $level);
        }
        echo '</pre>';
    }
    echo "<p>Exception was thrown on line <code>" . $e->getLine() . "</code> in <code>" . $e->getFile() . "</code></p>";
    $dispatcher_status = Dispatcher::getStatus();
    $dispatcher_status['request method'] = get_request_method();
    debug_table($dispatcher_status, 'Dispatcher status');
    if (!empty($_GET)) {
        debug_table($_GET, 'GET');
    }
    if (!empty($_POST)) {
        debug_table($_POST, 'POST');
    }
    if (!empty($_COOKIE)) {
        debug_table($_COOKIE, 'COOKIE');
    }
    debug_table($_SERVER, 'SERVER');
}
开发者ID:chaobj001,项目名称:tt,代码行数:74,代码来源:Framework.php


示例17: latest

 function latest($limit = 0, $folder = null)
 {
     $folder = str_replace(':', '/', $folder);
     if (trim($folder)) {
         $_SESSION['assets_folder'] = $folder;
     } else {
         $folder = $_SESSION['assets_folder'];
     }
     if ('AJAX' == get_request_method()) {
         $this->setLayout(null);
     }
     $this->display('assets/views/latest', array('image_array' => assets_latest($limit, $folder)));
 }
开发者ID:julpi,项目名称:freshcms_assets,代码行数:13,代码来源:AssetsController.php


示例18: index

 public function index()
 {
     // WIDGET SETTINGS
     if (get_request_method() == "POST" && isset($_POST["widget_action"]) && isset($_POST["widget_secure_token"])) {
         if (DashboardWidgets::setWidgetSettings($_POST["widget_action"], $_POST)) {
             redirect(get_url("plugins/dashboard"));
             die;
         }
     }
     // RENDER DASHBOARD
     ob_start();
     $this->renderDashboard();
     $this->content = ob_get_contents();
     ob_end_clean();
     // OUTPUT
     $render = new View("../layouts/backend", array("content_for_layout" => $this->content));
     $output = $render->render();
     print $output;
 }
开发者ID:pawedWolf,项目名称:wolfcms-dashboard,代码行数:19,代码来源:DashboardController.php


示例19: edit

 /**
  * Edit a page part form.
  *
  * @param id the id of the page part form to be edited
  */
 public function edit($id)
 {
     if (!($page_part_form = Record::findByIdFrom('PagePartForm', $id))) {
         Flash::set('error', __('Page part form not found'));
         redirect(get_url(self::PLUGIN_URL));
     }
     $data = self::Get_data();
     if (get_request_method() == 'POST' && $this->check_constraints($data)) {
         $this->update($page_part_form, $data);
     }
     $this->display('edit', array('action' => 'edit', 'page_part_form' => $page_part_form, 'outline_structure' => $this->create_view('structure', array('structure' => self::Get_structure($page_part_form)))));
 }
开发者ID:billzeller,项目名称:frog_page_part_forms,代码行数:17,代码来源:PagePartFormsController.php


示例20: dashboard_events_widget_render

function dashboard_events_widget_render()
{
    global $dashboardEvents;
    if (get_request_method() == "POST") {
        if (isset($_POST["dashboard_events"]) && $_POST["dashboard_events"] == "clear_all") {
            $dashboardEvents->clear();
            redirect(get_url("plugin/dashboard/"));
            die;
        }
    }
    $log_entries = Record::findAllFrom("DashboardLogEntry", "created_on=created_on ORDER BY created_on DESC");
    $path = WOLF_PATH_WIDGETS . "events/";
    ?>
			<form method="post" action="">
				<table class="dashboardTable" cellpadding="0" cellspacing="0" border="0">
					<thead>
						<tr>
							<th colspan="2"></th>
							<th><?php 
    echo __("Event");
    ?>
</th>
							<th class="moment"><?php 
    echo __("Time");
    ?>
 <img src="<?php 
    echo $path;
    ?>
img/sort.png" /></th>
						</tr>
					</thead>
					
					<tbody>
						<?php 
    $entrynum = 0;
    foreach ($log_entries as $entry) {
        ?>
									<tr class="<?php 
        echo odd_even();
        ?>
">
										<td class="hidden"><?php 
        echo $entrynum;
        ?>
</td>
										<td class="priority">
											<img src="<?php 
        echo $path;
        ?>
img/<?php 
        echo $entry->priority("string");
        ?>
.png" title="<?php 
        echo $entry->priority("string");
        ?>
" />
										</td>
										<td class="dashboardMessage"><?php 
        echo $entry->message;
        ?>
</td>
										<td class="date">
											<a title="<?php 
        echo $entry->created_on;
        ?>
"><?php 
        echo DateDifference::getString(new DateTime($entry->created_on));
        ?>
</a>
										</td>
									</tr>
								<?php 
        $entrynum++;
    }
    ?>
          
					</tbody>
				</table>

				<p class="buttons">
					<input type="hidden" name="dashboard_events" value="clear_all" />
					<input type="submit" name="dashboard_action" value="<?php 
    echo __("Clear all");
    ?>
" class="button" />
				</p>
			</form>
		<?php 
}
开发者ID:pawedWolf,项目名称:wolfcms-dashboard,代码行数:89,代码来源:index.php



注:本文中的get_request_method函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_request_title函数代码示例发布时间:2022-05-15
下一篇:
PHP get_request_item函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap