本文整理汇总了PHP中Map::getLocations方法的典型用法代码示例。如果您正苦于以下问题:PHP Map::getLocations方法的具体用法?PHP Map::getLocations怎么用?PHP Map::getLocations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Map
的用法示例。
在下文中一共展示了Map::getLocations方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public static function run()
{
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$map = new Map($_POST);
MapView::show($map->getLocations());
} else {
MapView::show(null);
}
}
示例2: Map
<!DOCTYPE html>
<html>
<head>
<title>MapView Tests</title>
</head>
<body>
<h1>MapView Tests</h1>
<h3>Should call MapView::show()</h3>
<hr/>
<?php
include_once "../includer.php";
$map = new Map(null);
$map->addLocation("Rome");
MapView::show($map->getLocations());
?>
</body>
</html>
示例3: Map
<!DOCTYPE html>
<html>
<head>
<title>Map Tests</title>
</head>
<body>
<h1>Map Tests</h1>
<?php
include_once "../includer.php";
$map = new Map(null);
echo "Map ID: " . $map->getMapID();
echo "<hr/>";
echo "<h3>Should add three locations to map and print</h3>";
$map->addLocation("New York");
$map->addLocation("London");
$map->addLocation("Rome");
foreach ($map->getLocations() as $location) {
echo "<h4>{$location}</h4>";
}
echo "<hr/>";
echo "<h3>Should remove last location and print remaining</h3>";
$map->removeLastLocation();
foreach ($map->getLocations() as $location) {
echo "<h4>{$location}</h4>";
}
echo "<hr/>";
?>
</body>
</html>