本文整理汇总了PHP中Location::GetStates方法的典型用法代码示例。如果您正苦于以下问题:PHP Location::GetStates方法的具体用法?PHP Location::GetStates怎么用?PHP Location::GetStates使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Location
的用法示例。
在下文中一共展示了Location::GetStates方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLocation
private function getLocation()
{
$location = new Location();
$location->Address = $this->locationStreet;
$location->City = $this->locationCity;
$location->State = Location::GetStates()[$this->locationState];
$location->Zip = $this->locationZip;
$result = Location::model()->findExisting($location);
if ($result == null) {
$location->save();
$result = $location;
}
return $result;
}
示例2:
</div>
</div>
</div>
<!------- end main content container----->
</div>
<style>
#map {
width: 100%;
height: 200px;
}
</style>
<?php
$address = $model->locationStreet . ', ' . $model->locationCity . ', ' . Location::GetStates()[$model->locationState];
?>
<script type="text/javascript">
$(document).ready(function ()
{
google.load('maps', '3.x', {other_params:'sensor=true', callback:function ()
{
$("#map").gmap3({
map :{
address :'<?php
echo $address;
?>
',
options :{
mapTypeId :google.maps.MapTypeId.ROADMAP,
示例3: foreach
<div class="row">
<div class="four columns">
<label class="inline right">Address</label>
</div>
<div class="eight columns">
<input id="address" type="text" placeholder="Street Address" />
</div>
</div>
<div class="row">
<div class="three columns offset-by-four">
<input id="city" type="text" placeholder="City">
</div>
<div class="two columns">
<select id="state">
<?php
foreach (Location::GetStates() as $state) {
echo "<option value='{$state}}'>{$state}</option>\n";
}
?>
</select>
</div>
<div class="three columns">
<input id="zip" type="text" maxlength="5" placeholder="Zip Code" />
</div>
</div>
</div>
<h4>Bank Account Information</h4>
<div class="row">
示例4: array
</div>
<div class="eight columns">
<?php
echo $form->textField($model, 'locationStreet', array('maxlength' => 2000, 'placeholder' => 'Street ex. 444 Charles Ave'));
?>
</div>
</div>
<div class="row">
<div class="three columns offset-by-four">
<?php
echo $form->textField($model, 'locationCity', array('maxlength' => 255, 'placeholder' => 'City'));
?>
</div>
<div class="three columns">
<?php
echo $form->dropDownList($model, 'locationState', Location::GetStates());
?>
</div>
<div class="two columns">
<?php
echo $form->textField($model, 'locationZip', array('maxlength' => 5));
?>
</div>
</div>
<?php
if (isset($model->Audience) && $model->Audience == ExperienceAudience::Kids) {
?>
<!----- Only show this if they previously selected that this is a kids experience------>
<div class="row">
示例5: array
</div>
<div class="eight columns">
<?php
echo $form->textField($model, 'locationStreet', array('maxlength' => 2000, 'placeholder' => 'Street ex. 444 Charles Ave'));
?>
</div>
</div>
<div class="row">
<div class="three columns offset-by-four">
<?php
echo $form->textField($model, 'locationCity', array('maxlength' => 255, 'placeholder' => 'City'));
?>
</div>
<div class="three columns">
<?php
echo $form->dropDownList($model, 'locationState', array_combine(Location::GetStates(), Location::GetStates()));
?>
</div>
<div class="two columns">
<?php
echo $form->textField($model, 'locationZip', array('maxlength' => 5));
?>
</div>
</div>
<?php
if (isset($model->Audience) && $model->Audience == ExperienceAudience::Kids) {
?>
<!----- Only show this if they previously selected that this is a kids experience------>
<div class="row">
示例6: setLocationState
public function setLocationState($value)
{
if (is_numeric($value)) {
$value = Location::GetStates()[$value];
}
$this->location->State = $value;
$this->location->save();
}