当前位置: 首页>>代码示例>>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;未经允许,请勿转载。