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