SOAP:

感覺是類似於Java中的HttpClient的東西,和curl也有點像。

PHPStorm中檢視所有的函式結構(Structure):Alt+7

查詢方法或類(Symbol Name 函式/方法名):Ctrl+Shift+Alt+N

程式碼摺疊 展開 (Collapse/Expand)

讓PHPStorm支援CodeIgniter中某些不識別的類和變數:

在system/core 的Controller和Model.php的CI_Controller和CI_Model類前加上類似這樣的註釋:

@property CI_DB $db
@property CI_Model $model
@property CI_Input $input
@property CI_Output $output

另據維基百科中的phpstorm條目

“PHPDoc support. The IDE provides code completion suggestions based on @property, @method and @var annotations. ”。

另據http://www.kuitao8.com/20141010/3137.shtml

第一類是檔案中的變數宣告,比如在某個程式碼檔案中聲明瞭變數$category,我們可以在這個程式碼檔案的開頭部分用註釋的方式申明一個指示器告訴PhpStorm變數的型別,就像下面這樣:

/* @var $category Category */

有了這個註釋,PhpStorm能夠自動查詢Category類的宣告檔案,編碼過程中PhpStorm就能直接提示。

第二類是類的屬性申明指示,還是以Category類的宣告為例,可以在類的上部宣告指示器,說明類的屬性以及屬性的型別,編碼方式如下:

/**

* @property string $name

*/

class Category

{}

PhpStorm能夠識別Category具有屬性$name。

第三類是迴圈,函式,條件結構內部的變數指示,我們以foreach迴圈為例,可以通過如下的方式宣告型別指示:

foreach($categories as $category)

{

/* @var $category Category */

$category->name

}

有了上面的指示,在迴圈結構的內部就能方便地使用程式碼提示了。

Google Chrome 外掛位置:

C:\Users\bibiFM\AppData\Local\Google\Chrome\User Data\Default\Extensions

EasyUI form load 方法

可以把json資料裝入到頁面上的form表單中。

文件:

http://jeasyui.com/documentation/form.php

load data Load records to fill the form. The data parameter can be a string or a object type, when string acts as a remote URL, otherwise acts as a local record.

Code example:

$('#ff').form('load','get_data.php');	// load from URL
$('#ff').form('load',{
name:'name2',
email:'[email protected]',
subject:'subject2',
message:'message2',
language:5
});

CI框架 資料庫查詢 示例

 1 <?php
2 // 聲音管理控制器
3 // by HapLeo 20150609
4 defined('BASEPATH') OR exit('No direct script access allowed');
5
6 class Beat extends CI_Controller
7 {
8 function __construct()
9 {
10 parent::__construct();
11 $this->load->model("public_model", "Public");
12 }
13
14
15
16 //聲音列表頁面
17 public function index()
18 {
19 $this->load->view("Beat/index");
20 }
21
22 //聲音列表資料
23 public function info()
24 {
25 $page = $this->input->post('page');//頁碼
26 $rows = $this->input->post('rows');//每頁顯示條數
27 $offset = ($page - 1) * $rows;//計算分頁偏移值
28
29 if (isset($_POST['title'])) {
30 $title = $this->input->post('title', true);
31 $this->db->like('title', $title);
32 }
33
34 $this->db->select("b.id,b.title,b.anonymous,b.releasetime,c.title category");
35 $this->db->from('bed_beat b');
36 $this->db->join("bed_category c","c.id = b.categoryid",'left');
37 $this->db->order_by("b.releasetime",'DESC');
38
39 //獲取結果總數
40 $count = $this->db->count_all_results('',false);
41
42 //分頁
43 $this->db->limit($rows,$offset); //沒有寫反。
44 //返回結果
45 $result = $this->db->get()->result_array();
46 /*//處理排序
47 $arr = array();
48 $num = 0;
49 foreach ($query as $k => $v) {
50 $arr[$num] = $v;
51 $num++;
52 if (isset($_POST['title'])) {
53 $title = $this->input->post('title', true);
54 $this->db->like('title', $title);
55 }
56 $this->db->order_by("sort", "desc");
57 $this->db->where("pid", $v['id']);
58 $queryc = $this->db->get("menu")->result_array();
59 foreach ($queryc as $k1 => $v1) {
60 $arr[$num] = $v1;
61 $num++;
62 }
63 }*/
64
65 $list['rows'] = $result;
66 $list['total'] = $count;
67 $result = $this->Public->jsonEncodeWithCN($list);
68 echo $result;
69 }
70
71
72
73 //行編輯
74 public function edit()
75 {
76 $this->load->view("Beat/form");
77 }
78 }

Fiddler 4

一個看請求的,類似於抓包的軟體……

可以設定為瀏覽器的代理……

感覺不錯……

PHP與Java及JS的異同

PHP的變數不用宣告,但是都要以$開頭。

陣列也可以直接拿來就賦值,比如$a['b']=3