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

PHP Header类代码示例

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

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



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

示例1: getHeader

 protected function getHeader()
 {
     $header = new Header();
     $header->title = $this->title;
     $header->meta("Content-Type", "text/html; charset=utf-8", true);
     $header->meta("description", $this->meta_desc, false);
     $header->meta("keywords", $this->meta_key, false);
     $header->meta("viewport", "width=device-width", false);
     $header->favicon = "/favicon.ico";
     if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 8.0')) {
         $header->css = array("/styles/main.css", "/styles/prettify.css", "/styles/unite-gallery.css", "/styles/ie.css");
     } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Safari/525.29')) {
         $header->css = array("/styles/main.css", "/styles/prettify.css", "/styles/unite-gallery.css", "/styles/safari3.css");
     } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7.0')) {
         $header->css = array("/styles/reject.css");
     } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6.0')) {
         $header->css = array("/styles/reject.css");
     } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 5.5')) {
         $header->css = array("/styles/reject.css");
     } else {
         $header->css = array("/styles/main.css", "/styles/prettify.css", "/styles/unite-gallery.css");
     }
     if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7.0')) {
         $header->js = array("/js/reject.min.js");
     } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6.0')) {
         $header->js = array("/js/reject.min.js");
     } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 5.5')) {
         $header->js = array("/js/reject.min.js");
     } else {
         $header->js = array("/js/jquery-11.0.min.js", "/js/functions.js", "/js/validator.js", "/js/prettify.js", "/js/unitegallery.min.js", "/js/ug-theme-compact.js");
     }
     return $header;
 }
开发者ID:andreiBall,项目名称:main-site,代码行数:33,代码来源:controller_class.php


示例2: invokeHandler

 public function invokeHandler(Smarty $viewModel, Header $header, $f, $page)
 {
     $header->title('PayPic');
     $header->import('jqgeeks/bootstrap_css', 'mypage');
     $viewModel->assign("pname", "@RTPic");
     return self::showLatest($viewModel);
 }
开发者ID:rx-projects,项目名称:comicasa,代码行数:7,代码来源:Images.php


示例3: getHandshake

	public function getHandshake($buffer) {
		$header = new Header($buffer);
        $params = $header->getParams();;
        
        if (isset($params['Sec-WebSocket-Key'])) {
	        $response = "HTTP/1.1 101 Switching Protocols\r\n";
	        $response .= "Upgrade: websocket\r\n";
	        $response .= "Connection: Upgrade\r\n";
	        $response .= "Sec-WebSocket-Accept: $acceptKey";
	        $response .= "\0";
        }
        else {
			$pattern = '/[^\d]*/';
			$replacement = '';
			$numkey1 = preg_replace($pattern, $replacement, $params['Sec-WebSocket-Key1']);
			$numkey2 = preg_replace($pattern, $replacement, $params['Sec-WebSocket-Key2']);
			$pattern = '/[^ ]*/';
			$replacement = '';
			$spaces1 = strlen(preg_replace($pattern, $replacement, $params['Sec-WebSocket-Key1']));
			$spaces2 = strlen(preg_replace($pattern, $replacement, $params['Sec-WebSocket-Key2']));
			$hashData = md5( pack("N", $numkey1/$spaces1) . pack("N", $numkey2/$spaces2) . $header->getMessage(), true);
        	
			$response = "HTTP/1.1 101 WebSocket Protocol Handshake\r\n";
			$response .= "Upgrade: WebSocket\r\n";
			$response .= "Connection: Upgrade\r\n";
			$response .= "Sec-WebSocket-Origin: " . $params['Origin'] . "\r\n";
			$response .= "Sec-WebSocket-Location: ws://" . "{$this->address}:{$this->port}" . $header->getResource() . "\r\n";
			$response .= "\r\n";
			$response .= $hashData;
			$response .= "\0";
        }
        return $response;
	}
开发者ID:renq,项目名称:HTML5-Chat,代码行数:33,代码来源:WebSocket.php


示例4: parseHeader

 function parseHeader()
 {
     if (!empty($this->header)) {
         return;
     }
     $this->header = new Header($this);
     $this->header->parse();
 }
开发者ID:akivaron,项目名称:toko,代码行数:8,代码来源:File.php


示例5: testToArray

 /**
  * Test the conversion of the header to an array
  */
 public function testToArray()
 {
     $key = 'somekey';
     $algorithm = 'H256';
     $type = 'mytype';
     $header = new Header($key, $algorithm, $type);
     $this->assertEquals($header->toArray(), array('typ' => $type, 'alg' => $algorithm));
 }
开发者ID:psecio,项目名称:jwt,代码行数:11,代码来源:HeaderTest.php


示例6: format

 /**
  * @return string
  */
 public function format()
 {
     $lines = '';
     foreach ($this->lines as $line) {
         $lines .= $line->format() . PHP_EOL;
     }
     return ($this->hasHeader() ? $this->header->format() . PHP_EOL : '') . trim($lines) . PHP_EOL;
 }
开发者ID:mybuilder,项目名称:cronos,代码行数:11,代码来源:Cron.php


示例7: addHeadersStr

 public function addHeadersStr($arr)
 {
     foreach ($arr as $key => $str) {
         $header = new Header();
         $header->setContent($str);
         $this->addHeader($header);
     }
 }
开发者ID:Chocanto,项目名称:autoTab,代码行数:8,代码来源:Table.php


示例8: test

 /**
  * Runs the test.
  */
 public function test()
 {
     $name = 'Organization';
     $value = 'Jyxo';
     // Email and name given
     $header = new Header($name, $value);
     $this->assertEquals($name, $header->getName());
     $this->assertEquals($value, $header->getValue());
 }
开发者ID:JerryCR,项目名称:php-2,代码行数:12,代码来源:HeaderTest.php


示例9: invokeHandler

 public function invokeHandler(Smarty $viewModel, Header $header, $f, $page, $aid)
 {
     $header->title('PayPic');
     $header->import('picbootstrap', 'mypage');
     $viewModel->assign("pname", "@RTPic");
     $album = new Album($aid);
     $viewModel->assign("images", $album->getImges());
     return "images";
 }
开发者ID:rx-projects,项目名称:comicasa,代码行数:9,代码来源:ViewAlbum.php


示例10: invokeHandler

 public function invokeHandler(Smarty $viewModel, Header $header, $f, $page)
 {
     $header->title('PayPic');
     $header->import('jqgeeks/bootstrap_css', 'mypage');
     $viewModel->assign("pname", "@RTPic");
     global $RDb;
     $imageAccess = $RDb->fetchAll("select * from file_access fa,files f,user u" . " where fa.pid=f.id and u.uid=fa.uid");
     $viewModel->assign("images", $imageAccess);
     return "imageAccess";
 }
开发者ID:rx-projects,项目名称:comicasa,代码行数:10,代码来源:ImageAccess.php


示例11: invokeHandler

 public function invokeHandler(Smarty $viewModel, Header $header, $f, $page, $pid)
 {
     $header->title('PayPic');
     $header->import('jqgeeks/bootstrap_css', 'mypage');
     $viewModel->assign("pname", "@RTPic");
     global $RDb;
     $image = $RDb->fetch("select * from files where id=%d", $pid);
     $viewModel->assign("image", $image);
     return "image";
 }
开发者ID:rx-projects,项目名称:comicasa,代码行数:10,代码来源:buyImage.php


示例12: testBuildEntityArrayWithValueOnly

 public function testBuildEntityArrayWithValueOnly()
 {
     $headerStr = '10.0.0.1,10.0.0.2,10.0.0.3';
     $header = new \Header('X-Forwarded-For', $headerStr, ',');
     $header->parseParams();
     $this->assertEquals(3, $header->count());
     $partsArray = $header->toArray();
     $this->assertEquals('10.0.0.1', $partsArray[0]);
     $entityArray = $header->buildEntityArray();
     $this->assertEquals(3, count($entityArray[0]));
 }
开发者ID:asgrim,项目名称:joindin-api,代码行数:11,代码来源:HeaderTest.php


示例13: invokeHandler

 public function invokeHandler(Smarty $viewModel, Header $header, User $user, $uname, $upass)
 {
     $header->title('PayPic');
     $header->import('jqgeeks/bootstrap_css', 'google_login');
     $viewModel->assign("pname", "@RTPic");
     if ($user->auth($uname, $upass)) {
         include_once HANDLER_PATH . "/Images.php";
         return Images::showlatest($viewModel);
     } else {
         return "login";
     }
 }
开发者ID:rx-projects,项目名称:comicasa,代码行数:12,代码来源:Submitlogin.php


示例14: saveHeader

 private function saveHeader($domain, $title, $charset, $keywords, $description, $icon, $lang)
 {
     $model = new Header();
     $model->domain = $domain;
     $model->title = $title;
     $model->charset = $charset;
     $model->keywords = $keywords;
     $model->description = $description;
     $model->icon = $icon;
     $model->lang = $lang;
     $model->save(false);
 }
开发者ID:nojdug,项目名称:domain,代码行数:12,代码来源:SaveCommand.php


示例15: renderPage

    public function renderPage()
    {
        print '

        <link href="css/bootstrap.css" rel="stylesheet">
        <link href="css/half-slider.css" rel="stylesheet">
        <link href="css/morris.css" rel="stylesheet">
        <title>Hardloopuitslagen.nl - Home</title>
       ';
        require_once "/Classes/header.php";
        $Header = new Header();
        $Header->renderHeader();
    }
开发者ID:WouterDoornbos,项目名称:Run2Day,代码行数:13,代码来源:home.php


示例16: invokeHandler

 public function invokeHandler(Smarty $viewModel, Header $header, User $user, $page)
 {
     $header->title('PayPic');
     $viewModel->assign("pname", "@RTPic");
     if ($user->isValid()) {
         $header->import('jqgeeks/bootstrap_css', 'upload');
         global $RDb;
         $images = $RDb->fetchAll("select * from files where uid=%d AND albumid=0", $user->getToken());
         $viewModel->assign("images", $images);
         return "upload";
     } else {
         $header->import('jqgeeks/bootstrap_css', 'google_login');
         return "login";
     }
 }
开发者ID:rx-projects,项目名称:comicasa,代码行数:15,代码来源:Upload.php


示例17: setHeader

 public function setHeader(Header $h)
 {
     // replace content if header already exists
     $replaced = false;
     for ($i = 0; $i < count($this->headers) && !$replaced; $i++) {
         if ($this->headers[$i]->getKey() == $h->getKey()) {
             $this->headers[$i]->setValue($h->getValue());
             $replaced = true;
         }
     }
     // no matches found, add new header
     if (!$replaced) {
         $this->headers[] = $h;
     }
 }
开发者ID:svgorbunov,项目名称:ScrollsModRepo,代码行数:15,代码来源:Mailer.php


示例18: get_index

 public function get_index()
 {
     $view = View::instance();
     try {
         if (isset($_SESSION['client_user'])) {
             $chat = $this->orm->chat[$_SESSION['client_user']['id_chat']];
             if ($chat['closed']) {
                 unset($_SESSION['client_user']);
             } elseif ($chat['id_support_user']) {
                 Header::redirect(URL::baseUrl() . '/conversation');
             } else {
                 Header::redirect(URL::baseUrl() . '/client/wait');
             }
         }
         $param = $this->orm->param();
         $param->select('value');
         $param->where('name', 'STATUS');
         $supportStatus = $param->fetch();
         $supportUser = $this->orm->support_user();
         $supportUser->where('active', 1);
         $supportUser->and('online', 1);
         $supportOnlineCount = $supportUser->count('id_support_user');
         if ($supportStatus['value'] == 1 && $supportOnlineCount > 0) {
             $view->render('form-client');
         } else {
             $view->render('offline');
         }
     } catch (Exception $e) {
         $view->render('offline');
     }
 }
开发者ID:sandroalvesperes,项目名称:chat,代码行数:31,代码来源:Start.php


示例19: ajaxCreate

 function ajaxCreate($server, $node, $id = false)
 {
     if (!$this->validateServerNode($server, $node)) {
         return;
     }
     $post = false;
     if ($id) {
         $pd = new \modl\PostnDAO();
         $p = $pd->getItem($id);
         if ($p->isEditable()) {
             $post = $p;
         }
     }
     $view = $this->tpl();
     $view->assign('to', $server);
     $view->assign('node', $node);
     $view->assign('item', $post);
     RPC::call('MovimTpl.fill', 'main section > div:nth-child(2)', $view->draw('_publish_create', true));
     $pd = new \Modl\ItemDAO();
     $item = $pd->getItem($server, $node);
     $view = $this->tpl();
     $view->assign('server', $server);
     $view->assign('node', $node);
     $view->assign('post', $post);
     $view->assign('item', $item);
     Header::fill($view->draw('_publish_header', true));
     if ($id) {
         RPC::call('Publish.initEdit');
     }
     RPC::call('Publish.setEmbed');
 }
开发者ID:christine-ho-dev,项目名称:movim,代码行数:31,代码来源:Publish.php


示例20: render

 public function render()
 {
     $layout = $this->content_for_template();
     $body = $this->content_for_layout($layout);
     // Needed for testing
     if (CUPCAKE_ENV === "test") {
         $dispatcher = DispatcherTest::getInstance();
         $dispatcher->__params = $this->view_params();
         $dispatcher->__view_params = $this->view_params;
         $dispatcher->__template = $this->template;
         $dispatcher->__layout = $this->layout;
         # Action might be false positive and controller aswell.
         $dispatcher->__controller = $this->controller;
         $dispatcher->__action = $this->params["action"];
         $dispatcher->__request_uri = $this->request_uri;
         $dispatcher->__body = $body;
         return;
     }
     if (!empty($this->content_type)) {
         Header::set("Content-Type", $this->content_type);
         Header::send();
     }
     echo $body;
     exit;
 }
开发者ID:ahmed555,项目名称:Cupcake,代码行数:25,代码来源:view.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP HeaderField类代码示例发布时间:2022-05-23
下一篇:
PHP Head类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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