本文整理匯總了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)));
}