本文整理匯總了PHP中Area::ads方法的典型用法代碼示例。如果您正苦於以下問題:PHP Area::ads方法的具體用法?PHP Area::ads怎麽用?PHP Area::ads使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Area
的用法示例。
在下文中一共展示了Area::ads方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Area
<?php
/**
* Created by PhpStorm.
* User: acer
* Date: 2015/7/21
* Time: 20:00
*/
header("Content-type : text/html ; charset = utf-8");
error_reporting(E_ALL ^ E_DEPRECATED ^ E_NOTICE);
require_once "Kijiji.php";
$id = $_GET['id'];
$c = new Area();
$c->id = $id ? $id : 2001;
$c->load();
print "<h1>{$c->name}</h1><p>";
foreach ($c->toRoot() as $cc) {
print "<a href=area.php?id={$cc->id}>{$cc->name}</a>|";
}
print "<p>";
foreach ($c->children() as $cc) {
print "<a href=area.php?id={$cc->id}>{$cc->name}</a>|";
}
print "<p>";
foreach ($c->ads() as $a) {
print "<li><a href=view.php?id={$a->id}>{$a->name}</a><br>";
}
示例2: Area
<?php
require_once 'Kijiji.php';
$id = @$_GET['id'];
$c = new Area();
$c->id = $id ? $id : 21;
$c->load();
print "<h1>{$c->name}</h1><p>";
foreach ($c->toRoot() as $cc) {
print "<a href=area.php?id={$cc->id}>{$cc->name}</a>|";
}
print "<p>";
foreach ($c->children() as $cc) {
print "<a href=area.php?id={$cc->id}>{$cc->name}</a>|";
}
print "<p>";
foreach ($c->ads() as $ad) {
print "<li><a href=view.php?id={$ad->id}>{$ad->name}</a>";
}