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


PHP JDocument::__construct方法代碼示例

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


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

示例1: __construct

 /**
  * Class constructor
  *
  * @param   array  $options  Associative array of options
  *
  * @since  11.1
  */
 public function __construct($options = array())
 {
     parent::__construct($options);
     // Set document type
     $this->_type = 'opensearch';
     // Set mime type
     $this->_mime = 'application/opensearchdescription+xml';
     // Add the URL for self updating
     $update = new JOpenSearchUrl();
     $update->type = 'application/opensearchdescription+xml';
     $update->rel = 'self';
     $update->template = JRoute::_(JUri::getInstance());
     $this->addUrl($update);
     // Add the favicon as the default image
     // Try to find a favicon by checking the template and root folder
     $app = JFactory::getApplication();
     $dirs = array(JPATH_THEMES . '/' . $app->getTemplate(), JPATH_BASE);
     foreach ($dirs as $dir) {
         if (file_exists($dir . '/favicon.ico')) {
             $path = str_replace(JPATH_BASE . '/', '', $dir);
             $path = str_replace('\\', '/', $path);
             $favicon = new JOpenSearchImage();
             $favicon->data = JUri::base() . $path . '/favicon.ico';
             $favicon->height = '16';
             $favicon->width = '16';
             $favicon->type = 'image/vnd.microsoft.icon';
             $this->addImage($favicon);
             break;
         }
     }
 }
開發者ID:WineWorld,項目名稱:joomlatrialcmbg,代碼行數:38,代碼來源:opensearch.php

示例2: __construct

 /**
  * Class constructor
  *
  * @param   array  $options  Associative array of options
  */
 public function __construct($options = array())
 {
     parent::__construct($options);
     //set mime type
     $this->_mime = 'text/html';
     //set document type
     $this->_type = 'raw';
 }
開發者ID:ramdesh,項目名稱:joomla-platform,代碼行數:13,代碼來源:raw.php

示例3: __construct

 /**
  * Class constructor
  *
  * @param   array  $options  Associative array of options
  *
  * @since   11.1
  */
 public function __construct($options = array())
 {
     parent::__construct($options);
     //set mime type
     $this->_mime = 'application/xml';
     //set document type
     $this->_type = 'xml';
 }
開發者ID:nibra,項目名稱:joomla-platform,代碼行數:15,代碼來源:xml.php

示例4: __construct

 /**
  * Class constructor
  *
  * @param   array  $options  Associative array of options
  *
  * @since   12.1
  */
 public function __construct($options = array())
 {
     parent::__construct($options);
     // Set mime type
     $this->_mime = 'image/png';
     // Set document type
     $this->_type = 'image';
 }
開發者ID:lyrasoft,項目名稱:lyrasoft.github.io,代碼行數:15,代碼來源:image.php

示例5: array

 function __construct($options = array())
 {
     // let the parent class do its bit
     parent::__construct($options);
     // set the MIME type
     $this->_type = 'yql';
     //$this->setMimeEncoding("application/json");
     $this->setAuthor('Fabrik');
 }
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:9,代碼來源:yqldocument.php

示例6: __construct

 /**
  * Class constructor
  *
  * @param	array	$options Associative array of options
  */
 public function __construct($options = array())
 {
     parent::__construct($options);
     //set document type
     $this->_type = 'html';
     //set default mime type and document metadata (meta data syncs with mime type by default)
     $this->setMetaData('Content-Type', 'text/html', true);
     $this->setMetaData('robots', 'index, follow');
 }
開發者ID:akksi,項目名稱:jcg,代碼行數:14,代碼來源:html.php

示例7: __construct

 /**
  * Class constructor
  *
  * @param   array  $options  Associative array of options
  *
  * @since  3.1
  */
 public function __construct($options = array())
 {
     parent::__construct($options);
     // Set default mime type.
     $this->_mime = 'application/json';
     // Set document type.
     $this->_type = 'hal+json';
     // Set absolute/relative hrefs.
     $this->absoluteHrefs = isset($options['absoluteHrefs']) ? $options['absoluteHrefs'] : false;
 }
開發者ID:prox91,項目名稱:joomla-dev,代碼行數:17,代碼來源:json.php

示例8: array

 /**
  * Class constructor
  *
  * @access protected
  * @param	array	$options Associative array of options
  */
 function __construct($options = array())
 {
     parent::__construct($options);
     //set document type
     $this->_type = 'html';
     //set mime type
     $this->_mime = 'text/html';
     //set default document metadata
     $this->setMetaData('Content-Type', $this->_mime . '; charset=' . $this->_charset, true);
     $this->setMetaData('robots', 'index, follow');
 }
開發者ID:jicheng17,項目名稱:comanova,代碼行數:17,代碼來源:html.php

示例9: __construct

 /**
  * Class constructor
  *
  * @param   array  $options  Associative array of options
  *
  * @since  11.1
  */
 public function __construct($options = array())
 {
     parent::__construct($options);
     // Set mime type
     if (isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'application/json') === false && strpos($_SERVER['HTTP_ACCEPT'], 'text/html') !== false) {
         // Internet Explorer < 10
         $this->_mime = 'text/plain';
     } else {
         $this->_mime = 'application/json';
     }
     // Set document type
     $this->_type = 'json';
 }
開發者ID:b-dur,項目名稱:joomla-cms,代碼行數:20,代碼來源:json.php

示例10: array

 /**
  * Class constructore
  *
  * @access protected
  * @param	array	$options Associative array of options
  */
 function __construct($options = array())
 {
     parent::__construct($options);
     if (isset($options['margin-header'])) {
         $this->_margin_header = $options['margin-header'];
     }
     if (isset($options['margin-footer'])) {
         $this->_margin_footer = $options['margin-footer'];
     }
     if (isset($options['margin-top'])) {
         $this->_margin_top = $options['margin-top'];
     }
     if (isset($options['margin-bottom'])) {
         $this->_margin_bottom = $options['margin-bottom'];
     }
     if (isset($options['margin-left'])) {
         $this->_margin_left = $options['margin-left'];
     }
     if (isset($options['margin-right'])) {
         $this->_margin_right = $options['margin-right'];
     }
     if (isset($options['image-scale'])) {
         $this->_image_scale = $options['image-scale'];
     }
     //set mime type
     $this->_mime = 'application/pdf';
     //set document type
     $this->_type = 'pdf';
     /*
      * Setup external configuration options
      */
     //	define('K_TCPDF_EXTERNAL_CONFIG', true);
     /*
      * Create the pdf document
      */
     // Default settings are a portrait layout with an A4 configuration using millimeters as units
     if (!class_exists('TCPDF')) {
         require JPATH_ROOT . DS . 'libraries' . DS . 'tcpdf' . DS . 'tcpdf.php';
     }
     $this->_engine = new TCPDF('P', 'mm', 'A4', true, 'UTF-8', true);
     //set margins
     $this->_engine->SetMargins($this->_margin_left, $this->_margin_top, $this->_margin_right);
     //set auto page breaks
     $this->_engine->SetAutoPageBreak(TRUE, $this->_margin_bottom);
     $this->_engine->SetHeaderMargin($this->_margin_header);
     $this->_engine->SetFooterMargin($this->_margin_footer);
     $this->_engine->setImageScale($this->_image_scale);
 }
開發者ID:spiridonov-oa,項目名稱:SheinCandles,代碼行數:54,代碼來源:pdf.php

示例11: __construct

 /**
  * Class constructor
  *
  * @param   array   $options   Associative array of options
  * @param   string  $mimeType  Document type
  *
  * @since  1.4
  */
 public function __construct($options = array(), $mimeType = 'json')
 {
     parent::__construct($options);
     $this->documentFormat = $options['documentFormat'];
     if (!in_array($this->documentFormat, array('json'))) {
         $this->documentFormat = 'json';
     }
     // Set default mime type.
     $this->_mime = 'application/' . $mimeType;
     // Set document type.
     $this->_type = 'json';
     // Set absolute/relative hrefs.
     $this->absoluteHrefs = isset($options['absoluteHrefs']) ? $options['absoluteHrefs'] : true;
     // Set token if needed
     $this->uriParams = isset($options['uriParams']) ? $options['uriParams'] : array();
 }
開發者ID:thangredweb,項目名稱:redCORE,代碼行數:24,代碼來源:document.php

示例12: __construct

 /**
  * Class constructor
  *
  * @param   array  $options  Associative array of options
  *
  * @since  11.1
  */
 public function __construct($options = array())
 {
     parent::__construct($options);
     // Set document type
     $this->_type = 'feed';
 }
開發者ID:lyrasoft,項目名稱:lyrasoft.github.io,代碼行數:13,代碼來源:feed.php

示例13: array

 /**
  * Class constructor
  *
  * @access protected
  * @param   array	$options Associative array of options
  */
 function __construct($options = array())
 {
     parent::__construct($options);
     //set document type
     $this->_type = 'fabrikfeed';
 }
開發者ID:ankaau,項目名稱:GathBandhan,代碼行數:12,代碼來源:fabrikfeed.php

示例14: array

 /**
  * Class constructore
  *
  * @access protected
  * @param	array	$options Associative array of options
  */
 function __construct($options = array())
 {
     parent::__construct($options);
     if (isset($options['margin-header'])) {
         $this->_margin_header = $options['margin-header'];
     }
     if (isset($options['margin-footer'])) {
         $this->_margin_footer = $options['margin-footer'];
     }
     if (isset($options['margin-top'])) {
         $this->_margin_top = $options['margin-top'];
     }
     if (isset($options['margin-bottom'])) {
         $this->_margin_bottom = $options['margin-bottom'];
     }
     if (isset($options['margin-left'])) {
         $this->_margin_left = $options['margin-left'];
     }
     if (isset($options['margin-right'])) {
         $this->_margin_right = $options['margin-right'];
     }
     if (isset($options['image-scale'])) {
         $this->_image_scale = $options['image-scale'];
     }
     //set mime type
     $this->_mime = 'application/pdf';
     //set document type
     $this->_type = 'pdf';
     /*
      * Setup external configuration options
      */
     define('K_TCPDF_EXTERNAL_CONFIG', true);
     /*
      * Path options
      */
     // Installation path
     define("K_PATH_MAIN", JPATH_LIBRARIES . DS . "tcpdf");
     // URL path
     define("K_PATH_URL", JPATH_BASE);
     // Fonts path
     define("K_PATH_FONTS", JPATH_SITE . DS . 'language' . DS . "pdf_fonts" . DS);
     // Cache directory path
     define("K_PATH_CACHE", K_PATH_MAIN . DS . "cache");
     // Cache URL path
     define("K_PATH_URL_CACHE", K_PATH_URL . DS . "cache");
     // Images path
     define("K_PATH_IMAGES", K_PATH_MAIN . DS . "images");
     // Blank image path
     define("K_BLANK_IMAGE", K_PATH_IMAGES . DS . "_blank.png");
     /*
      * Format options
      */
     // Cell height ratio
     define("K_CELL_HEIGHT_RATIO", 1.25);
     // Magnification scale for titles
     define("K_TITLE_MAGNIFICATION", 1.3);
     // Reduction scale for small font
     define("K_SMALL_RATIO", 2 / 3);
     // Magnication scale for head
     define("HEAD_MAGNIFICATION", 1.1);
     /*
      * Create the pdf document
      */
     jimport('tcpdf.tcpdf');
     // Default settings are a portrait layout with an A4 configuration using millimeters as units
     $this->_engine = new TCPDF();
     //set margins
     $this->_engine->SetMargins($this->_margin_left, $this->_margin_top, $this->_margin_right);
     //set auto page breaks
     $this->_engine->SetAutoPageBreak(TRUE, $this->_margin_bottom);
     $this->_engine->SetHeaderMargin($this->_margin_header);
     $this->_engine->SetFooterMargin($this->_margin_footer);
     $this->_engine->setImageScale($this->_image_scale);
 }
開發者ID:jicheng17,項目名稱:comanova,代碼行數:80,代碼來源:pdf.php

示例15: __construct

 /**
  * Class constructor
  *
  * @param   array  $options  Associative array of options
  *
  * @since   11.1
  */
 public function __construct($options = array())
 {
     parent::__construct($options);
     // Set document type
     $this->_type = 'html';
     // Set default mime type and document metadata (meta data syncs with mime type by default)
     $this->setMimeEncoding('text/html');
 }
開發者ID:rvsjoen,項目名稱:joomla-platform,代碼行數:15,代碼來源:html.php


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