当前位置: 首页>>代码示例>>PHP>>正文


PHP Location::GetStates方法代码示例

本文整理汇总了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;
 }
开发者ID:noahkim,项目名称:kowop,代码行数:14,代码来源:ExperienceCreateForm.php

示例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,
开发者ID:noahkim,项目名称:kowop,代码行数:31,代码来源:_createForm7.php

示例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">
开发者ID:noahkim,项目名称:kowop,代码行数:31,代码来源:_bankaccount.php

示例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">
开发者ID:noahkim,项目名称:kowop,代码行数:31,代码来源:_createForm4.php

示例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">
开发者ID:noahkim,项目名称:kowop,代码行数:31,代码来源:update.php

示例6: setLocationState

 public function setLocationState($value)
 {
     if (is_numeric($value)) {
         $value = Location::GetStates()[$value];
     }
     $this->location->State = $value;
     $this->location->save();
 }
开发者ID:noahkim,项目名称:kowop,代码行数:8,代码来源:Experience.php


注:本文中的Location::GetStates方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。