本文整理汇总了PHP中HtmlElement::ReturnData方法的典型用法代码示例。如果您正苦于以下问题:PHP HtmlElement::ReturnData方法的具体用法?PHP HtmlElement::ReturnData怎么用?PHP HtmlElement::ReturnData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HtmlElement
的用法示例。
在下文中一共展示了HtmlElement::ReturnData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetLocations
public function GetLocations()
{
# Create Location Drop-Down
$this->CheckMyLocation();
parent::SetQuery("SELECT * FROM `aggregate_deal_region` ORDER BY location ASC");
$locations = parent::DoQuery();
$locationLinks = array();
parent::SetQuery("SELECT * FROM `aggregate_deal_region` WHERE aggregate_deal_region_id='{$this->localData["location_id"]}'");
$cityInfo = parent::DoQuery();
$first_city = $cityInfo[0]["location"];
foreach ($locations as $location) {
// location dropdowns
$link_div = new HtmlElement('div');
$link_div->Set('style', 'padding: 8px; padding-left: 20px;');
$link_div->Set('onmouseover', 'this.style.backgroundColor=\'#794933\';');
$link_div->Set('onmouseout', 'this.style.backgroundColor=\'transparent\';');
$link = new HtmlElement('a');
$link->Set('href', $this->localData["current_page"] . '?location_id=' . $location["location_id"]);
$link->Set('class', 'city-dropdown-link');
$link->Set('text', $location["location"]);
$link_div->Inject($link);
if ($location["location"] != $first_city) {
// don't display the currently selected city
$locationLinks[] = $link_div->ReturnData();
}
}
$this->JsonOutput(array("first_city" => $first_city, "cities" => join("", $locationLinks)));
}