當前位置: 首頁>>代碼示例>>PHP>>正文


PHP messages::is_reload方法代碼示例

本文整理匯總了PHP中messages::is_reload方法的典型用法代碼示例。如果您正苦於以下問題:PHP messages::is_reload方法的具體用法?PHP messages::is_reload怎麽用?PHP messages::is_reload使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在messages的用法示例。


在下文中一共展示了messages::is_reload方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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::is_reload方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。