當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Component::print_headers方法代碼示例

本文整理匯總了PHP中Component::print_headers方法的典型用法代碼示例。如果您正苦於以下問題:PHP Component::print_headers方法的具體用法?PHP Component::print_headers怎麽用?PHP Component::print_headers使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Component的用法示例。


在下文中一共展示了Component::print_headers方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: output

	/**
	 * Выводит результат работы компонента
	 */
	public function output()
	{
		Component::print_headers();

		$this->objects->call("handler_bind");
		$this->objects->call("handler_output");
	}
開發者ID:nDIGAH3CEYIiCsq,項目名稱:gold,代碼行數:10,代碼來源:component.inc.php

示例2: output

	/**
	 * Отправляет данные картинку капчи на сервер
	 */
	public function output()
	{
		$captcha = $this->Common->gen_password(CAPTCHA_LENGTH, false);
		$captcha = strtoupper($captcha);

		$_SESSION['captcha'] = $captcha;

		$width		= 15 + CAPTCHA_LENGTH * self::SymbolWidth + 15;

		$image		= imagecreatetruecolor($width, self::ImageHeight);
		$backcolor	= imagecolorallocate($image, 0xFF, 0xFF, 0xFF);

		imagefill($image, 0, 0, $backcolor);

		for ($i = 0; $i < self::PointsCount; $i++)
		{
			$color = imagecolorallocate($image, mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255));
			imagesetpixel($image, mt_rand(0, $width), mt_rand(0, self::ImageHeight), $color);
		}

		for ($i = 0; $i < CAPTCHA_LENGTH; $i++)
		{
			$color = imagecolorallocate($image, mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255));
			imagettftext($image, self::FontSize, mt_rand(-15, 15), 15 + $i * self::SymbolWidth, 35, $color, CAPTCHA_FONT_LOCATION, $captcha[$i]);
		}

		Component::print_headers("image/png", false);

		imagepng($image);
		imagedestroy($image);

		exit;
	}
開發者ID:nDIGAH3CEYIiCsq,項目名稱:gold,代碼行數:36,代碼來源:captcha.inc.php

示例3: send_empty

	private function send_empty()
	{
		Component::print_headers();

		echo json_encode(array('aaData' => array()));
		exit;
	}
開發者ID:nDIGAH3CEYIiCsq,項目名稱:gold,代碼行數:7,代碼來源:tables.inc.php

示例4: on_add_item

	public function on_add_item()
	{
		Component::print_headers("text/xml");

		$fields = array('order_id'		=> array('filter' => FILTER_VALIDATE_INT),
				'code'			=> array('filter' => FILTER_VALIDATE_INT),
				'size'			=> array('require' => false, 'filter' => FILTER_VALIDATE_FLOAT),
				'count'			=> array('filter' => FILTER_VALIDATE_INT),
				'name'			=> array(),
				'price'			=> array('filter' => FILTER_VALIDATE_INT),
				'initial_price'		=> array('filter' => FILTER_VALIDATE_FLOAT),
				'status_manager'	=> array()

		    );
		$fields = $this->EasyForms->fields($fields);
		if ($fields === false)
		{
			$this->XML->send_error("Не верно заполнены поля");
			exit;
		}
		if ($fields['size'] < 0 || $fields['size'] > 100)
		{
			$this->XML->send_error("Не верно заполнено поле размер");
			exit;
		}
		if ($fields['count'] <= 0 || $fields['count'] > 100)
		{
			$this->XML->send_error("Не верно заполнено поле кол-во");
			exit;
		}
		if ($fields['price'] <= 0 || $fields['price'] > 1000000)
		{
			$this->XML->send_error("Не верно заполна цена продажи");
			exit;
		}
		if ($fields['initial_price'] <= 0 || $fields['initial_price'] > 1000000)
		{
			$this->XML->send_error("Не верно заполнена цена отгрузки");
			exit;
		}

		$new_id = $this->Orders->add_order_items($fields['order_id'], array($fields));
		$fields['id'] = $new_id[0];

		$this->Orders->update_price($fields['order_id'], $fields['price']  * $fields['count']);

		$template = $this->Templates->get("");

		$order_item = $template->order_item;
		if ($order_item === false)
			$this->Log->error("Can't find 'order_item' param");

		$fields[$fields['status_manager']] = true;
		$fields['status_manager'] = $this->get_manager_status($fields['status_manager']);
		$order_item->bind_params($fields);
		$fields['status_manager'] = "ignored";

		$xml = $this->XML->start_answer();
		$xml->addChild("item", (string) $order_item);
		$this->XML->send_xml($xml);
	}
開發者ID:nDIGAH3CEYIiCsq,項目名稱:gold,代碼行數:61,代碼來源:report.inc.php

示例5: set_page

	/**
	 * Устанавливает страницу для отображения
	 * @param $page_name String: Имя страницы
	 */
	public function set_page($page_name)
	{
		$this->set($page_name);

		$this->header = false;
		$this->footer = false;

		if (empty($this->template))
			return;

		$template = $this->get("/".$this->template);

		$content_type = $template->get_param("Pages::Content-type");
		if ($content_type !== false)
			Component::print_headers((string) $content_type);

		if (isset($template->params['Pages::Header']))
		{
			$this->header = $template->params['Pages::Header'];
			unset($template->params['Pages::Header']);
		}

		if (isset($template->params['Pages::Footer']))
		{
			$this->footer = $template->params['Pages::Footer'];
			unset($template->params['Pages::Footer']);
		}

		$this->assign_params($template);
	}
開發者ID:nDIGAH3CEYIiCsq,項目名稱:gold,代碼行數:34,代碼來源:templates.inc.php

示例6: on_set_count

	public function on_set_count()
	{
		Component::print_headers();
		$fields = array(
			'id'		=> array(),
			'count'		=> array(),
			'size'		=> array(),
			'product_id'	=> array()
		);

		$fields = $this->EasyForms->fields($fields, array('flags' => FILTER_VALIDATE_INT));
		if ($fields === false)
			exit;

		$order = $this->Orders->get($fields['id']);
		if ($order === false)
			exit;

		$order['products'] = unserialize($order['products']);
		if (!isset($orders['products'][$fields['product_id']][$fields['size']]))
			exit;

		$order['products'][$fields['product_id']][$fields['size']] = $fields['count'];

		$summary = $this->Basket->summary($order['products']);
		$summary = $summary['buy'];
		$this->Orders->update($fields['id'], array('products' =>  serialize($order['products']), 'price' => $summary['price']));

		echo $this->format_list_products($order['products']);
		exit;
	}
開發者ID:nDIGAH3CEYIiCsq,項目名稱:gold,代碼行數:31,代碼來源:orders.inc.php

示例7: on_export_submit

	/**
	 * Отображает данные экспорта страниц
	 */
	public function on_export_submit()
	{
		$fields = array(
			'names'		=> array('array' => true),
			'compress'	=> array('require' => false),
			'trim'		=> array('require' => false),
		);

		$fields = $this->EasyForms->fields($fields);
		if (!$fields)
			$this->Log->error("No page names specified");

		if (empty($fields['compress']))
			$fields['compress'] = "none";

		$fields['trim'] = intval($fields['trim']);

		$export = array();

		if (!empty($fields['names']))
		{
			$result = $this->Pages->get_all($fields['names']);

			while (($row = $result->fetch()))
			{
				if ($fields['trim'] != 0)
				{
					$pieces = explode("/", $row['name']);
					$pieces = array_slice($pieces, $fields['trim']);

					$row['name'] = implode("/", $pieces);
				}

				$data = $this->Common->copy_fields($row, array("name", "params", "content"));
				$this->Common->remove_empty($data);

				array_push($export, $data);
			}
		}

		$export = serialize($export);
		$export = $this->Compress->compress($export, $fields['compress']);

		header("Content-Length: ".strlen($export));
		header("Content-Disposition: attachment; filename=\"export.itw\"");
		header("Content-Transfer-Encoding: binary");

		Component::print_headers("application/octet-stream", false);

		echo $export;
		exit;
	}
開發者ID:nDIGAH3CEYIiCsq,項目名稱:gold,代碼行數:55,代碼來源:pages.inc.php

示例8: on_get_categories

	/**
	 * Получение всех категорий
	 */
	public function on_get_categories()
	{
		Component::print_headers();
		$template = $this->Templates->get("");

		$category_item = $template->category_item;
		if ($category_item === false)
			$this->Log->error("Can't find 'category_item' param");

		$categories = $this->News->get_categories();
		echo $this->Lists->make($category_item, $categories);
		exit;
	}
開發者ID:nDIGAH3CEYIiCsq,項目名稱:gold,代碼行數:16,代碼來源:news.inc.php

示例9: send_as_xml

	/**
	 * Отправляет данные инкапсулированными в XML-объект
	 * @param $element String: Данные для передачи
	 */
	public function send_as_xml($element)
	{
		$buffer = ob_get_clean();

		$xml = $this->start_answer();
		$xml->addChild($element, $buffer);

		Component::print_headers("text/xml");

		echo $xml->asXML();
		exit;
	}
開發者ID:nDIGAH3CEYIiCsq,項目名稱:gold,代碼行數:16,代碼來源:xml.inc.php


注:本文中的Component::print_headers方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。