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


PHP State::get方法代码示例

本文整理汇总了PHP中State::get方法的典型用法代码示例。如果您正苦于以下问题:PHP State::get方法的具体用法?PHP State::get怎么用?PHP State::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在State的用法示例。


在下文中一共展示了State::get方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: stateShouldKeepItemsByRuleNumberAndPosition

 /**
  * @test
  */
 public function stateShouldKeepItemsByRuleNumberAndPosition()
 {
     $item1 = new Item(new Rule(1, 'E', array('E', '+', 'T')), 0);
     $state = new State(0, array($item1));
     $this->assertSame($item1, $state->get(1, 0));
     $item2 = new Item(new Rule(2, 'T', array('T', '+', 'F')), 0);
     $state->add($item2);
     $this->assertSame($item2, $state->get(2, 0));
 }
开发者ID:MPV,项目名称:AspectMock-test,代码行数:12,代码来源:StateTest.php

示例2: load_states

 public function load_states()
 {
     $country_id = $_POST['country_id'];
     $states = new State();
     if ($country_id > 0) {
         $states->where('country_id', $country_id);
     }
     $states->get();
     echo '<select name="state_id" class="form-control">';
     echo '<option value="">-- select state --</option>';
     foreach ($states as $key => $state_item) {
         echo '<option value="' . $state_item->id . '">' . $state_item->state_name . '</option>';
     }
     echo '</select>';
 }
开发者ID:ultraauchz,项目名称:asean_cultural_mapping,代码行数:15,代码来源:states.php

示例3: notify

 /**
  * Register a notification.
  * 
  * @param   string $message The message to print.
  * @param   string $type    The type of notification [self::ERROR|self::SUCCESS|self::INFO].
  */
 static function notify($message, $type)
 {
     $nots = State::get('notifications');
     array_push($nots, array('message' => $message, 'type' => $type));
     State::set('notifications', $nots);
 }
开发者ID:Air-Craft,项目名称:air-craft-www,代码行数:12,代码来源:Notifier.php

示例4: update

 /**
  * Save/reset/load component values.
  */
 private function update()
 {
     $errors = array();
     switch (State::get('action')) {
         case 'save':
             $errors = $this->save();
             Notifier::success('Settings saved.');
             break;
         case 'reset-section':
             $section = $this->config->get_section_by_slug(State::get('active_section'));
             $this->reset($section);
             Notifier::success('<strong>' . $section->title . '</strong> section was reset to its default settings.');
             break;
         case 'reset-all':
             $this->reset();
             Notifier::success('All sections were reset to their default settings.');
             break;
             // No submission (simple request)
         // No submission (simple request)
         default:
             $this->load();
     }
     $this->set_errors($errors);
 }
开发者ID:Air-Craft,项目名称:air-craft-www,代码行数:27,代码来源:OptionsPage.php

示例5:

<!DOCTYPE html>
<html lang="es"><head>
	<title><?php 
echo State::get('title');
?>
</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">

	<link rel="stylesheet" type="text/css" href="<?php 
echo Settings::host();
?>
lib/stys/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="<?php 
echo Settings::host();
?>
lib/stys/font-awesome.min.css">
	<link rel="stylesheet" type="text/css" href="<?php 
echo Settings::host();
?>
lib/stys/global.css"> 

	<script type="text/javascript" src="<?php 
echo Settings::host();
?>
lib/scrs/jquery.min.js"></script> 
	<script type="text/javascript" src="<?php 
echo Settings::host();
?>
lib/scrs/jquery-ui.min.js"></script> 
	<script type="text/javascript" src="<?php 
echo Settings::host();
开发者ID:samueleishion,项目名称:TLLL,代码行数:31,代码来源:header.php

示例6: Rating

    $request = \Slim\Slim::getInstance()->request();
    $rating = json_decode($request->getBody());
    $ratingDAO = new Rating();
    $ratingDAO->update($rating);
    echo '{"result":"ok"}';
});
$app->delete('/rating', function () {
    $request = \Slim\Slim::getInstance()->request();
    $rating = json_decode($request->getBody());
    $ratingDAO = new Rating();
    $ratingDAO->delete($rating);
    echo '{"result":"ok"}';
});
$app->get('/state', function () {
    $stateDAO = new State();
    $result = $stateDAO->get();
    echo json_encode($result);
});
$app->post('/state', function () {
    $request = \Slim\Slim::getInstance()->request();
    $state = json_decode($request->getBody());
    $stateDAO = new State();
    $stateDAO->insert($state);
    echo '{"result":"ok"}';
});
$app->put('/state', function () {
    $request = \Slim\Slim::getInstance()->request();
    $state = json_decode($request->getBody());
    $stateDAO = new State();
    $stateDAO->update($state);
    echo '{"result":"ok"}';
开发者ID:,项目名称:,代码行数:31,代码来源:


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