本文整理汇总了PHP中State::set方法的典型用法代码示例。如果您正苦于以下问题:PHP State::set方法的具体用法?PHP State::set怎么用?PHP State::set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类State
的用法示例。
在下文中一共展示了State::set方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
/**
* Returns the state with the given id. If no such state exists, a new
* state is returned.
*/
function get($_id)
{
$_id = 'x';
$state = new State();
$state->id = $_id;
if (!is_readable($this->_filename_of($_id))) {
return $state;
}
$pairs = parse_ini_file($this->_filename_of($_id));
foreach ($pairs as $key => $value) {
$state->set($key, $value);
}
return $state;
}
示例2: reset
static function reset()
{
State::set('notifications', array());
}
示例3: State
"><?php
echo $row['name'];
?>
</option>
<?php
}
?>
</select>
</div>
</td>
</tr>
<?php
$id = Request::get("id");
if (is_numeric($id) && $id > 0) {
$stateObj = new State();
$stateObj->set("state_id", $id);
$result = $stateObj->getName();
if (count($result)) {
$row = $result[0];
$state_id = $row['id'];
$country_id = $row['country_id'];
$state_name = $row['name'];
$state_status = $row['active'];
}
}
?>
<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>
<input type="text" name="state_name" value="<?php
示例4: set_errors
/**
* Set the state with the given errors.
*
* @param array $errors
*/
private function set_errors($errors)
{
if (count($errors) == 0) {
return;
}
$errors_array = array();
foreach ($this->config->get_sections() as $section) {
foreach ($section->get_fields() as $component) {
if ($component instanceof \Amarkal\UI\ValidatableComponentInterface && $errors[$component->get_name()]) {
$errors_array[] = array('section' => $section->get_slug(), 'message' => $errors[$component->get_name()]);
}
}
}
State::set('errors', $errors_array);
}
示例5:
<?php
State::set('title', 'Total Lucha Libre Latina');
require_once 'app/partials/header/header.php';
require_once 'app/partials/nav/nav.php';
?>
<link rel="stylesheet" href="app/modules/home/home.css">
<script src="app/modules/home/home.js"></script>
<div class="section-home">
<!-- <section class="banner flat">
<div class="carousel slide" id="myCarousel" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1" class="active"></li>
<li data-target="#myCarousel" data-slide-to="2" class="active"></li>
</ol>
<div class="carousel-inner" role="listbox">
<div class="item">
<div class="container">
<div class="row">
<div class="col-lg-12">
Item 0
</div>
</div>
</div>
</div>
<div class="item">
示例6:
<?php
State::set('title', 'Hegel.js 404');
require_once 'app/partials/header/header.php';
require_once 'app/partials/nav/nav.php';
?>
<div class="container">
<div class="row">
<div class="col-sm-12 text-center">
<h1>404</h1>
</div>
</div>
</div>
<?php
require_once 'app/partials/footer/footer.php';