本文整理汇总了PHP中Collection::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Collection::init方法的具体用法?PHP Collection::init怎么用?PHP Collection::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Collection
的用法示例。
在下文中一共展示了Collection::init方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Collection
// 新浪微博RSS Feed生成器草根用户版, 作者 @williamlong [ http://www.williamlong.info ]
$username = $_GET["id"];
// request any username with '?id='
if (empty($username)) {
$username = '2373313250';
// <-- change this to your username!
} else {
// Make sure username request is alphanumeric
$username = ereg_replace("[^A-Za-z0-9]", "", $username);
}
$feedURL = 'http://v.t.sina.com.cn/widget/widget_blog.php?height=500&skin=wd_01&showpic=1&uid=' . $username;
$C = new Collection();
$C->url = $feedURL;
$C->startFlag = '<div id="content_all" class="wgtList">';
$C->endFlag = '<div id="rolldown" class="wgtMain_bot">';
$C->init();
$C->regExp = "|<p class=\"wgtCell_txt\">(.*)</p>(.*)<a href=\"(.*)\" title=\"\" target=\"_blank\" class=\"link_d\">|Uis";
$C->parse();
header("Content-type:application/xml");
?>
<rss version="2.0">
<channel>
<title>rssfeed</title>
<link>rssfeed</link>
<description>rssfeed</description>
<language>zh-cn</language>
<?php
for ($i = 0; $i <= 9; $i++) {
$tguid = $C->result[$i][3];
$tcon = strip_tags($C->result[$i][1]);
示例2: testInit
/**
* Test
*
* @return void
*/
public function testInit()
{
$this->assertNull($this->object->init());
}
示例3: testInit
/**
* Test
*
* @return void
*/
public function testInit()
{
$this->object->init();
$layouts = $this->object->getLayouts();
$this->assertTrue(count($layouts) >= 1);
}
示例4: testInit
/**
* Test
*
* @return void
*/
public function testInit()
{
$this->object->init(true);
$this->assertInternalType('array', $this->object->getRoles());
}