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


PHP messages::set_message方法代码示例

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


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

示例1: test_get_current_message

 public function test_get_current_message()
 {
     $m = new messages();
     //No message has been set
     $this->assertEquals('', $m->get_current_message());
     //Set a message and check if it's ok
     $m->set_message('general-ok-0');
     $this->assertEquals('Command OK', $m->get_current_message());
 }
开发者ID:jucachap,项目名称:huge-challenge,代码行数:9,代码来源:messagestest.class.php

示例2: add_content

 public static function add_content($content_id, $content_name)
 {
     ob_start();
     if (file_exists(config::get_config('tpl_config')['bloks_folder'] . '/' . $content_name . '.php')) {
         require config::get_config('tpl_config')['bloks_folder'] . '/' . $content_name . '.php';
     } else {
         messages::set_message('20', 'alert-danger');
     }
     self::$content[$content_id] = ob_get_contents();
     ob_end_clean();
 }
开发者ID:Ate1st,项目名称:test,代码行数:11,代码来源:render.php

示例3: set

 public function set($params, $options = null)
 {
     //var_dump($params);
     $last_id = 0;
     if ($options != null) {
         $this->options = $options;
     }
     $this->prepared = $this->pdo->prepare($this->query_builder->get_query(), $this->options);
     $this->pdo->beginTransaction();
     var_dump($this->prepared);
     if (!$this->prepared) {
         $this->pdo->rollBack();
         messages::set_message('30', 'alert-danger');
         return $last_id;
     }
     $this->prepared->execute($params);
     $last_id = $this->pdo->lastInsertId();
     $this->pdo->commit();
     return $last_id;
 }
开发者ID:Ate1st,项目名称:test,代码行数:20,代码来源:mapper.php

示例4: call

 public static function call($route, $params = null)
 {
     self::$route = $route;
     self::$params = $params;
     if (!class_exists(self::$route[0] . '_controller')) {
         self::$route[0] = config::get_config('app_config')['default_controller'] . '_controller';
         messages::set_message('00', 'alert-danger');
     } else {
         self::$route[0] = self::$route[0] . '_controller';
     }
     if (!isset(self::$route[1])) {
         self::$route[1] = config::get_config('app_config')['default_action'];
     }
     if (method_exists(self::$route[0], self::$route[1])) {
         self::$route[1] = self::$route[1];
     } else {
         self::$route[1] = config::get_config('app_config')['default_action'];
         messages::set_message('01', 'alert-danger');
     }
     call_user_func_array(self::$route, self::$params);
 }
开发者ID:Ate1st,项目名称:test,代码行数:21,代码来源:controller.php

示例5: process_command

 /**
  * This method process the command given by the user and call the right action to be applied.
  * @param Array $command 
  * @param string $canvas_string 
  * @return string
  */
 public function process_command()
 {
     //Obj to handle messages
     $messages = new messages();
     if ($this->values_ok) {
         switch (strtoupper($this->command_array[0])) {
             //Create a Canvas
             case 'C':
                 if (count($this->command_array) == 3) {
                     $command = $this->command_array;
                     $this->canvas = new canvas($command[1], $command[2]);
                     $messages->set_message('general-ok-0');
                 } else {
                     $messages->set_message('general-error-0');
                     $messages->is_reload();
                 }
                 break;
                 //Print a Line
             //Print a Line
             case 'L':
                 if (!$this->canvas->get_canvas_state()) {
                     $messages->set_message('line-error-1');
                 } elseif (count($this->command_array) == 5) {
                     $command = $this->command_array;
                     $this->canvas->draw_line(array($command[1], $command[2]), array($command[3], $command[4]), $messages);
                     $messages->set_message('general-ok-0');
                 } else {
                     $messages->set_message('general-error-0');
                 }
                 break;
                 //Print a Rectangle
             //Print a Rectangle
             case 'R':
                 if (!$this->canvas->get_canvas_state()) {
                     $messages->set_message('rec-error-0');
                 } elseif (count($this->command_array) == 5) {
                     $command = $this->command_array;
                     $this->canvas->draw_rectangle(array($command[1], $command[2]), array($command[3], $command[4]));
                     $messages->set_message('general-ok-0');
                 } else {
                     $messages->set_message('general-error-0');
                 }
                 break;
                 //Bucket fill action
             //Bucket fill action
             case 'B':
                 if (!$this->canvas->get_canvas_state()) {
                     $messages->set_message('line-error-1');
                 } elseif (count($this->command_array) == 4) {
                     $command = $this->command_array;
                     $this->canvas->bucket_fill(array($command[1], $command[2]), $command[3]);
                     $messages->set_message('general-ok-0');
                 } else {
                     $messages->set_message('general-error-0');
                 }
                 break;
                 //Restart the app
             //Restart the app
             case 'Q':
                 $messages->set_message('general-ok-0');
                 $messages->is_reload();
                 break;
             default:
                 break;
         }
     } else {
         return false;
     }
     return $this->canvas->get_canvas_string($messages) . '<br/>' . $messages->get_current_message();
 }
开发者ID:jucachap,项目名称:huge-challenge,代码行数:76,代码来源:command.class.php


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