本文整理汇总了PHP中XML::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP XML::__construct方法的具体用法?PHP XML::__construct怎么用?PHP XML::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XML
的用法示例。
在下文中一共展示了XML::__construct方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($db, $settings, $page)
{
parent::__construct($db);
$this->settings = $settings;
$this->page = $page;
if ($this->page->ajax_request) {
$this->mode = "xml";
$this->add_layout_data = false;
} else {
if (isset($_GET["output"])) {
if (($this->mode = $_GET["output"]) == "raw") {
$this->mode = "xml";
} else {
$this->add_layout_data = false;
}
}
}
$this->language = $this->settings->default_language;
$this->description = $this->settings->head_description;
$this->set_layout();
/* Mobile devices
*/
$mobiles = array("iPhone", "Android");
foreach ($mobiles as $mobile) {
if (strpos($_SERVER["HTTP_USER_AGENT"], $mobile) !== false) {
$this->mobile = true;
}
}
}
示例2: __construct
/**
* Instantiates an RSS Encoder.
*
* @param array $channelElements An assosiative array of channel elements. Per RSS
* specification: title, link, and description are
* required. "element" => "value"
* @param array $itemElements An array of elements to include in each data item;
* for example, title, link, author, etc...
* @param array $data An array of items in the feed
* @param array $dataMap An associative array mapping fields in the items
* passed $data array to RSS-specific fields.
* "UserField" => "RSSField"
* For example:
* $dataMap = array(
* "published" => "pubDate",
* "body" => "description"
* );
*/
public function __construct($channelElements, $itemElements, $data, $dataMap = array())
{
parent::__construct($data);
$this->channelElements = $channelElements;
$this->itemElements = $itemElements;
$this->dataMap = $dataMap;
$this->setupFeed();
}
示例3: __construct
public function __construct($name, $url, $title, $img, $author)
{
$this->url = $url;
$this->title = $title;
$this->img = $img;
$this->author = $author;
$date = new \DateTime();
$this->date = $date->format('Y-m-d\\TH:i:s\\Z');
$this->initEntries();
parent::__construct($name, 'xml version="1.0" encoding="utf-8"');
}
示例4: __construct
/**
* Class constructor initiates parent class and sends all the
* required parameters to the parent
*/
public function __construct()
{
parent::__construct(Configuration::getXMLPath() . $this->xml_file);
}