当前位置: 首页>>代码示例>>PHP>>正文


PHP Header类代码示例

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


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


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