本文整理汇总了PHP中State::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP State::getAll方法的具体用法?PHP State::getAll怎么用?PHP State::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类State
的用法示例。
在下文中一共展示了State::getAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: site
if (isset($_POST['own_domain'])) {
echo $_POST['own_domain'];
}
?>
" name="own_domain" style="display: block;">
<small>Caso possua informe aqui o domínio próprio do seu site (ele será usado no lugar do sub-domínio)</small>
</td>
</tr>
<tr class="form-field" style="display: none;">
<th scope="row"><label for="state">Localização</label></th>
<td>
<label for="state">Estado</label>
<select name="state" id="state">
<option value="">Selecione</option>
<?php
foreach (State::getAll() as $state) {
?>
<option value="<?php
echo $state->id;
?>
" <?php
if (isset($_POST['state']) && $_POST['state'] == $state->id) {
echo ' selected="selected" ';
}
?>
>
<?php
echo $state->name;
?>
</option>
<?php
示例2: State
<div class="control-group">
<form action="#" method="POST">
<table style="margin-left: 20%;" width="100%" >
<tr>
<td>
<label class="control-label" for="selectError">State</label>
</td>
<td>
<div class="input-group" style="width: 50%">
<span class="input-group-addon"></span>
<select required="" name="state_id" class="form-control">
<option value="">--Select State--</option>
<?php
$countryObj = new State();
$rows = $countryObj->getAll();
foreach ($rows as $row) {
?>
<option value="<?php
echo $row['id'];
?>
"><?php
echo $row['name'];
?>
</option>
<?php
}
?>
</select>
示例3: State
Add
</a><br/><br/>
<table class="table table-striped table-bordered bootstrap-datatable datatable responsive">
<thead>
<tr>
<th>Id</th>
<th>State </th>
<th>Country </th>
<th>Status</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
$stateObj = new State();
$rows = $stateObj->getAll();
foreach ($rows as $row) {
?>
<tr>
<td><?php
echo $row['id'];
?>
</td>
<td class="center"><?php
echo $row['name'];
?>
</td>
<td class="center"><?php
echo $row['country_name'];