legend---五、如何优雅的实现多继承

一、总结

一句话总结:多继承可以通过把别人对象作为属性来调用属性的方法执行,

继承的本质也是为了调用方法和属性,而上述的方式可以满足

1、php中前端可以共用后端的方法么?

前端里面公用后端的php文件,可可以非常方便,方法函数写过的就不用再写了

//在前后引入后台的php
use app\admin\controller\Task as AdminTask;

这样还有好处就是,要修改的时候特别方便

2、弄成函数的方式真是超级好呢?

修改超级方便

还不容易出错

 1 //获取模块名
2 function getModuleName(){
3 //这种方式不可取,后面如果弄了地址映射,那这个又要错
4 //在到达页面之前是先到达了后端,所以这个可以用session来完成
5 // dump($_SERVER);die;
6 // $path_infoArr=explode('/',$_SERVER['PATH_INFO']);
7 // $length=count($path_infoArr);
8 // return $path_infoArr[$length-1-1];
9 return session('index_module_name');
10 }

3、如何在index里面优雅的调用adminphp里面的方法?

任务那里,其实都差不多一样,其实我就想直接拿admin里面的任务的方法来用

这样的好处是便于修改

但是多继承不能实现,把对象作为属性的话好像又有问题

4、多继承可以通过把别人对象作为属性来调用属性的方法执行(超级重要)?

//在前后引入后台的php
use app\admin\controller\Task as AdminTask;
class Task extends Base
{
public function index(){
$adminTask=new AdminTask();
$adminTask->index();
return view();
}
}

这个index()方法可以让当前页面有值

    public function index(){
$adminTask=new AdminTask();
//其实我想知道额就是index()方法里面取的那些数据有没有被分配到这个的页面上
$adminTask->index();
//数据是有传递到页面的
//必须有这个return view();把数据返回给桌面,虽然上面的index()里面也有这句话
return view();
}

5、如何验证后台数据是否传递到页面?

<body>
{:dump($taskReward)}

直接在页面dump就行

6、如何判断一个字符串是否包含另外一个字符串?

php如何判断一个字符串是否包含另一个字符串 我觉得最简单的就是: strpos($a, $b) !== false 如果$a 中存在 $b,则为 true ,否则为 false。 用 !== false (或者 === false) 的原因是如果 $b 正好位于$a的开始部分,那么该函数会返回int(0),...

7、mysql 让清空表且自增的id重新从0开始的命令是什么?

sql命令: 用于清空某表的数据 且让自增的id重新从0开始

truncate table 你的表名    

8、直接调用后台模型或者控制器的好处是什么?

直接调用后台的方法,非常方便,因为后台写了,所以所有的数据是全部都分配好了的

调用的方法

第九句和第十句

 1 public function index(){
2 $muid=base64_decode(session('muid'));
3 //1、获取用户的用户信息和身份信息
4 $modelPersonal=new ModelPersonal();
5 $this->assign('userInfo',$modelPersonal->getUserInfo($muid));//用户信息
6 $this->assign('stateInfo',$modelPersonal->getStateInfo());//身份信息
7
8 //2、获取用户的物品信息
9 $myselfGoods=new MyselfGoods();
10 $myselfGoods->index();
11 //dump($myselfGoods);die;
12
13 return view();
14 }
分配的数据
  1 object(app\admin\controller\MyselfGoods)#21 (5) {
2 ["beforeActionList":protected] => array(1) {
3 [0] => string(13) "assignSession"
4 }
5 ["view":protected] => object(think\View)#6 (3) {
6 ["engine"] => object(think\view\driver\Think)#7 (2) {
7 ["template":"think\view\driver\Think":private] => object(think\Template)#8 (5) {
8 ["data":protected] => array(0) {
9 }
10 ["config":protected] => array(27) {
11 ["view_path"] => string(117) "E:\2017-02-21--SoftWare\PHP\SOFTWARE\phpStudy_New\PHPTutorial\WWW\svn\legend\legend\public/../application/index\view\"
12 ["view_base"] => string(0) ""
13 ["view_suffix"] => string(3) "php"
14 ["view_depr"] => string(1) "\"
15 ["cache_suffix"] => string(3) "php"
16 ["tpl_deny_func_list"] => string(9) "echo,exit"
17 ["tpl_deny_php"] => bool(false)
18 ["tpl_begin"] => string(2) "\{"
19 ["tpl_end"] => string(2) "\}"
20 ["strip_space"] => bool(false)
21 ["tpl_cache"] => bool(true)
22 ["compile_type"] => string(4) "file"
23 ["cache_prefix"] => string(0) ""
24 ["cache_time"] => int(0)
25 ["layout_on"] => bool(false)
26 ["layout_name"] => string(6) "layout"
27 ["layout_item"] => string(13) "{__CONTENT__}"
28 ["taglib_begin"] => string(2) "\{"
29 ["taglib_end"] => string(2) "\}"
30 ["taglib_load"] => bool(true)
31 ["taglib_build_in"] => string(2) "cx"
32 ["taglib_pre_load"] => string(0) ""
33 ["display_cache"] => bool(false)
34 ["cache_id"] => string(0) ""
35 ["tpl_replace_string"] => array(0) {
36 }
37 ["tpl_var_identify"] => string(5) "array"
38 ["cache_path"] => string(97) "E:\2017-02-21--SoftWare\PHP\SOFTWARE\phpStudy_New\PHPTutorial\WWW\svn\legend\legend\runtime\temp\"
39 }
40 ["literal":"think\Template":private] => array(0) {
41 }
42 ["includeFile":"think\Template":private] => array(0) {
43 }
44 ["storage":protected] => object(think\template\driver\File)#9 (0) {
45 }
46 }
47 ["config":protected] => array(5) {
48 ["view_base"] => string(0) ""
49 ["view_path"] => string(117) "E:\2017-02-21--SoftWare\PHP\SOFTWARE\phpStudy_New\PHPTutorial\WWW\svn\legend\legend\public/../application/index\view\"
50 ["view_suffix"] => string(3) "php"
51 ["view_depr"] => string(1) "\"
52 ["tpl_cache"] => bool(true)
53 }
54 }
55 ["data":protected] => array(9) {
56 ["base_module"] => array(4) {
57 ["login"] => array(1) {
58 ["title"] => string(12) "legend登录"
59 }
60 ["task"] => array(1) {
61 ["title"] => string(12) "任务中心"
62 }
63 ["index"] => array(1) {
64 ["title"] => string(27) "第一章、英雄的觉醒"
65 }
66 ["personal"] => array(1) {
67 ["title"] => string(12) "个人中心"
68 }
69 }
70 ["userInfo"] => array(15) {
71 ["muid"] => int(1)
72 ["mu_login_id"] => int(6)
73 ["muname"] => string(6) "饭饭"
74 ["mugrade"] => int(2)
75 ["mudebt"] => int(72000)
76 ["mubigthan"] => int(730)
77 ["muexperience"] => int(20)
78 ["muexist"] => int(15)
79 ["mufortune"] => int(10)
80 ["mucontribution"] => int(0)
81 ["muachievement"] => int(0)
82 ["mu_yuan"] => int(0)
83 ["mu_havetime"] => int(0)
84 ["mu_luck"] => int(0)
85 ["mu_charm"] => int(0)
86 }
87 ["stateInfo"] => array(12) {
88 [0] => array(4) {
89 ["mst_id"] => int(1)
90 ["mst_name"] => string(6) "魂士"
91 ["mst_desc"] => string(21) "魂士 一级~十级"
92 ["mst_begingrade"] => int(0)
93 }
94 [1] => array(4) {
95 ["mst_id"] => int(2)
96 ["mst_name"] => string(6) "魂师"
97 ["mst_desc"] => string(29) "魂师 十一级~二十级"
98 ["mst_begingrade"] => int(10)
99 }
100 [2] => array(4) {
101 ["mst_id"] => int(4)
102 ["mst_name"] => string(9) "大魂师"
103 ["mst_desc"] => string(33) "大魂师 二十一级~三十级"
104 ["mst_begingrade"] => int(20)
105 }
106 [3] => array(4) {
107 ["mst_id"] => int(5)
108 ["mst_name"] => string(6) "魂尊"
109 ["mst_desc"] => string(31) "魂尊 三十一级~四十级"
110 ["mst_begingrade"] => int(30)
111 }
112 [4] => array(4) {
113 ["mst_id"] => int(6)
114 ["mst_name"] => string(6) "魂宗"
115 ["mst_desc"] => string(32) "魂宗 四十一级~五十级"
116 ["mst_begingrade"] => int(40)
117 }
118 [5] => array(4) {
119 ["mst_id"] => int(7)
120 ["mst_name"] => string(6) "魂王"
121 ["mst_desc"] => string(31) "魂王 五十一级~六十级"
122 ["mst_begingrade"] => int(50)
123 }
124 [6] => array(4) {
125 ["mst_id"] => int(8)
126 ["mst_name"] => string(6) "魂帝"
127 ["mst_desc"] => string(31) "魂帝 六十一级~七十级"
128 ["mst_begingrade"] => int(60)
129 }
130 [7] => array(4) {
131 ["mst_id"] => int(9)
132 ["mst_name"] => string(6) "魂圣"
133 ["mst_desc"] => string(31) "魂圣 七十一级~八十级"
134 ["mst_begingrade"] => int(70)
135 }
136 [8] => array(4) {
137 ["mst_id"] => int(10)
138 ["mst_name"] => string(9) "魂斗罗"
139 ["mst_desc"] => string(34) "魂斗罗 八十一级~九十级"
140 ["mst_begingrade"] => int(80)
141 }
142 [9] => array(4) {
143 ["mst_id"] => int(11)
144 ["mst_name"] => string(12) "封号斗罗"
145 ["mst_desc"] => string(40) "封号斗罗 九十一级~九十四级"
146 ["mst_begingrade"] => int(90)
147 }
148 [10] => array(4) {
149 ["mst_id"] => int(12)
150 ["mst_name"] => string(12) "超级斗罗"
151 ["mst_desc"] => string(40) "超级斗罗 九十五级~九十八级"
152 ["mst_begingrade"] => int(95)
153 }
154 [11] => array(4) {
155 ["mst_id"] => int(13)
156 ["mst_name"] => string(12) "极限斗罗"
157 ["mst_desc"] => string(33) "极限斗罗 九十九级~百级"
158 ["mst_begingrade"] => int(99)
159 }
160 }
161 ["base_userData"] => array(15) {
162 ["muid"] => int(1)
163 ["mu_login_id"] => int(6)
164 ["muname"] => string(6) "饭饭"
165 ["mugrade"] => int(2)
166 ["mudebt"] => int(72000)
167 ["mubigthan"] => int(730)
168 ["muexperience"] => int(20)
169 ["muexist"] => int(15)
170 ["mufortune"] => int(10)
171 ["mucontribution"] => int(0)
172 ["muachievement"] => int(0)
173 ["mu_yuan"] => int(0)
174 ["mu_havetime"] => int(0)
175 ["mu_luck"] => int(0)
176 ["mu_charm"] => int(0)
177 }
178 ["base_stateData"] => array(12) {
179 [0] => array(4) {
180 ["mst_id"] => int(1)
181 ["mst_name"] => string(6) "魂士"
182 ["mst_desc"] => string(21) "魂士 一级~十级"
183 ["mst_begingrade"] => int(0)
184 }
185 [1] => array(4) {
186 ["mst_id"] => int(2)
187 ["mst_name"] => string(6) "魂师"
188 ["mst_desc"] => string(29) "魂师 十一级~二十级"
189 ["mst_begingrade"] => int(10)
190 }
191 [2] => array(4) {
192 ["mst_id"] => int(4)
193 ["mst_name"] => string(9) "大魂师"
194 ["mst_desc"] => string(33) "大魂师 二十一级~三十级"
195 ["mst_begingrade"] => int(20)
196 }
197 [3] => array(4) {
198 ["mst_id"] => int(5)
199 ["mst_name"] => string(6) "魂尊"
200 ["mst_desc"] => string(31) "魂尊 三十一级~四十级"
201 ["mst_begingrade"] => int(30)
202 }
203 [4] => array(4) {
204 ["mst_id"] => int(6)
205 ["mst_name"] => string(6) "魂宗"
206 ["mst_desc"] => string(32) "魂宗 四十一级~五十级"
207 ["mst_begingrade"] => int(40)
208 }
209 [5] => array(4) {
210 ["mst_id"] => int(7)
211 ["mst_name"] => string(6) "魂王"
212 ["mst_desc"] => string(31) "魂王 五十一级~六十级"
213 ["mst_begingrade"] => int(50)
214 }
215 [6] => array(4) {
216 ["mst_id"] => int(8)
217 ["mst_name"] => string(6) "魂帝"
218 ["mst_desc"] => string(31) "魂帝 六十一级~七十级"
219 ["mst_begingrade"] => int(60)
220 }
221 [7] => array(4) {
222 ["mst_id"] => int(9)
223 ["mst_name"] => string(6) "魂圣"
224 ["mst_desc"] => string(31) "魂圣 七十一级~八十级"
225 ["mst_begingrade"] => int(70)
226 }
227 [8] => array(4) {
228 ["mst_id"] => int(10)
229 ["mst_name"] => string(9) "魂斗罗"
230 ["mst_desc"] => string(34) "魂斗罗 八十一级~九十级"
231 ["mst_begingrade"] => int(80)
232 }
233 [9] => array(4) {
234 ["mst_id"] => int(11)
235 ["mst_name"] => string(12) "封号斗罗"
236 ["mst_desc"] => string(40) "封号斗罗 九十一级~九十四级"
237 ["mst_begingrade"] => int(90)
238 }
239 [10] => array(4) {
240 ["mst_id"] => int(12)
241 ["mst_name"] => string(12) "超级斗罗"
242 ["mst_desc"] => string(40) "超级斗罗 九十五级~九十八级"
243 ["mst_begingrade"] => int(95)
244 }
245 [11] => array(4) {
246 ["mst_id"] => int(13)
247 ["mst_name"] => string(12) "极限斗罗"
248 ["mst_desc"] => string(33) "极限斗罗 九十九级~百级"
249 ["mst_begingrade"] => int(99)
250 }
251 }
252 ["modules"] => array(2) {
253 [0] => array(4) {
254 ["id"] => int(29)
255 ["name"] => string(6) "myself"
256 ["cnname"] => string(12) "自身管理"
257 ["pid"] => int(0)
258 }
259 [1] => array(4) {
260 ["id"] => int(61)
261 ["name"] => string(5) "goods"
262 ["cnname"] => string(12) "物品管理"
263 ["pid"] => int(29)
264 }
265 }
266 ["myselfGoods"] => object(think\paginator\driver\Bootstrap)#35 (8) {
267 ["simple":protected] => bool(false)
268 ["items":protected] => object(think\Collection)#36 (1) {
269 ["items":protected] => array(5) {
270 [0] => array(20) {
271 ["mg_id"] => int(4)
272 ["mg_uid"] => int(1)
273 ["mg_goods_id"] => int(4)
274 ["mg_number"] => int(10)
275 ["sg_id"] => int(4)
276 ["sg_name"] => string(6) "电脑"
277 ["sg_desc"] => string(46) "超级好的最新的笔记本电脑,
278 10级"
279 ["sg_classifyid"] => int(2)
280 ["sg_gradeid"] => int(11)
281 ["sg_icon"] => string(14) "am-icon-laptop"
282 ["sg_is_star_goods"] => int(0)
283 ["sg_is_fragment_goods"] => int(0)
284 ["sg_is_number_goods"] => int(1)
285 ["sc_id"] => int(2)
286 ["sc_name"] => string(9) "实物类"
287 ["sc_desc"] => string(9) "实物类"
288 ["sgr_id"] => int(11)
289 ["sgr_name"] => string(6) "十级"
290 ["sgr_desc"] => string(6) "十级"
291 ["sgr_color"] => string(7) "#fffa12"
292 }
293 [1] => array(20) {
294 ["mg_id"] => int(3)
295 ["mg_uid"] => int(1)
296 ["mg_goods_id"] => int(77)
297 ["mg_number"] => int(10)
298 ["sg_id"] => int(77)
299 ["sg_name"] => string(12) "小说两章"
300 ["sg_desc"] => string(21) "小说,实力之源"
301 ["sg_classifyid"] => int(2)
302 ["sg_gradeid"] => int(2)
303 ["sg_icon"] => string(0) ""
304 ["sg_is_star_goods"] => int(0)
305 ["sg_is_fragment_goods"] => int(0)
306 ["sg_is_number_goods"] => int(2)
307 ["sc_id"] => int(2)
308 ["sc_name"] => string(9) "实物类"
309 ["sc_desc"] => string(9) "实物类"
310 ["sgr_id"] => int(2)
311 ["sgr_name"] => string(6) "一级"
312 ["sgr_desc"] => string(9) "普通级"
313 ["sgr_color"] => string(7) "#FFFFFF"
314 }
315 [2] => array(20) {
316 ["mg_id"] => int(2)
317 ["mg_uid"] => int(1)
318 ["mg_goods_id"] => int(50)
319 ["mg_number"] => int(10)
320 ["sg_id"] => int(50)
321 ["sg_name"] => string(18) "四星龙猫碎片"
322 ["sg_desc"] => string(0) ""
323 ["sg_classifyid"] => int(3)
324 ["sg_gradeid"] => int(8)
325 ["sg_icon"] => string(0) ""
326 ["sg_is_star_goods"] => int(0)
327 ["sg_is_fragment_goods"] => int(1)
328 ["sg_is_number_goods"] => int(1)
329 ["sc_id"] => int(3)
330 ["sc_name"] => string(9) "碎片类"
331 ["sc_desc"] => string(9) "碎片类"
332 ["sgr_id"] => int(8)
333 ["sgr_name"] => string(6) "七级"
334 ["sgr_desc"] => string(6) "七级"
335 ["sgr_color"] => string(7) "#b580ff"
336 }
337 [3] => array(20) {
338 ["mg_id"] => int(1)
339 ["mg_uid"] => int(1)
340 ["mg_goods_id"] => int(34)
341 ["mg_number"] => int(10)
342 ["sg_id"] => int(34)
343 ["sg_name"] => string(9) "爆炸卡"
344 ["sg_desc"] => string(46) "爆炸卡:按命运炸掉1道错误的题目"
345 ["sg_classifyid"] => int(4)
346 ["sg_gradeid"] => int(5)
347 ["sg_icon"] => string(12) "am-icon-bomb"
348 ["sg_is_star_goods"] => int(0)
349 ["sg_is_fragment_goods"] => int(0)
350 ["sg_is_number_goods"] => int(1)
351 ["sc_id"] => int(4)
352 ["sc_name"] => string(9) "游戏类"
353 ["sc_desc"] => string(9) "游戏类"
354 ["sgr_id"] => int(5)
355 ["sgr_name"] => string(6) "四级"
356 ["sgr_desc"] => string(6) "四级"
357 ["sgr_color"] => string(7) "#2cff3e"
358 }
359 [4] => array(20) {
360 ["mg_id"] => int(5)
361 ["mg_uid"] => int(1)
362 ["mg_goods_id"] => int(76)
363 ["mg_number"] => int(10)
364 ["sg_id"] => int(76)
365 ["sg_name"] => string(15) "超级金柳露"
366 ["sg_desc"] => string(51) "用于四星和五星宠物重新刷新初始能力"
367 ["sg_classifyid"] => int(6)
368 ["sg_gradeid"] => int(11)
369 ["sg_icon"] => string(0) ""
370 ["sg_is_star_goods"] => int(0)
371 ["sg_is_fragment_goods"] => int(0)
372 ["sg_is_number_goods"] => int(1)
373 ["sc_id"] => int(6)
374 ["sc_name"] => string(9) "宠物类"
375 ["sc_desc"] => string(9) "宠物类"
376 ["sgr_id"] => int(11)
377 ["sgr_name"] => string(6) "十级"
378 ["sgr_desc"] => string(6) "十级"
379 ["sgr_color"] => string(7) "#fffa12"
380 }
381 }
382 }
383 ["currentPage":protected] => int(1)
384 ["lastPage":protected] => int(1)
385 ["total":protected] => int(5)
386 ["listRows":protected] => int(30)
387 ["hasMore":protected] => bool(false)
388 ["options":protected] => array(6) {
389 ["var_page"] => string(4) "page"
390 ["path"] => string(36) "/index.php/index/personal/index.html"
391 ["query"] => array(0) {
392 }
393 ["fragment"] => string(0) ""
394 ["type"] => string(9) "bootstrap"
395 ["list_rows"] => int(15)
396 }
397 }
398 ["sc_id"] => NULL
399 ["shopClassifyData"] => array(8) {
400 [0] => array(3) {
401 ["sc_id"] => int(2)
402 ["sc_name"] => string(9) "实物类"
403 ["sc_desc"] => string(9) "实物类"
404 }
405 [1] => array(3) {
406 ["sc_id"] => int(3)
407 ["sc_name"] => string(9) "碎片类"
408 ["sc_desc"] => string(9) "碎片类"
409 }
410 [2] => array(3) {
411 ["sc_id"] => int(4)
412 ["sc_name"] => string(9) "游戏类"
413 ["sc_desc"] => string(9) "游戏类"
414 }
415 [3] => array(3) {
416 ["sc_id"] => int(5)
417 ["sc_name"] => string(12) "属性点类"
418 ["sc_desc"] => string(12) "属性点类"
419 }
420 [4] => array(3) {
421 ["sc_id"] => int(6)
422 ["sc_name"] => string(9) "宠物类"
423 ["sc_desc"] => string(9) "宠物类"
424 }
425 [5] => array(3) {
426 ["sc_id"] => int(7)
427 ["sc_name"] => string(9) "抽奖类"
428 ["sc_desc"] => string(9) "抽奖类"
429 }
430 [6] => array(3) {
431 ["sc_id"] => int(8)
432 ["sc_name"] => string(9) "技能类"
433 ["sc_desc"] => string(9) "技能类"
434 }
435 [7] => array(3) {
436 ["sc_id"] => int(10)
437 ["sc_name"] => string(9) "其它类"
438 ["sc_desc"] => string(9) "其它类"
439 }
440 }
441 }
442 ["replace":protected] => array(8) {
443 ["__ROOT__"] => string(0) ""
444 ["__URL__"] => string(25) "/index.php/index/personal"
445 ["__STATIC__"] => string(7) "/static"
446 ["__CSS__"] => string(11) "/static/css"
447 ["__JS__"] => string(10) "/static/js"
448 ["__PUBLIC__"] => string(14) "/static/public"
449 ["__ADMIN__"] => string(13) "/static/admin"
450 ["__INDEX__"] => string(13) "/static/index"
451 }
452 }
453 ["request":protected] => object(think\Request)#2 (32) {
454 ["method":protected] => string(3) "GET"
455 ["domain":protected] => NULL
456 ["url":protected] => string(36) "/index.php/index/personal/index.html"
457 ["baseUrl":protected] => string(36) "/index.php/index/personal/index.html"
458 ["baseFile":protected] => string(10) "/index.php"
459 ["root":protected] => string(10) "/index.php"
460 ["pathinfo":protected] => string(25) "index/personal/index.html"
461 ["path":protected] => string(20) "index/personal/index"
462 ["routeInfo":protected] => array(0) {
463 }
464 ["dispatch":protected] => array(2) {
465 ["type"] => string(6) "module"
466 ["module"] => array(3) {
467 [0] => string(5) "index"
468 [1] => string(8) "personal"
469 [2] => string(5) "index"
470 }
471 }
472 ["module":protected] => string(5) "index"
473 ["controller":protected] => string(8) "Personal"
474 ["action":protected] => string(5) "index"
475 ["langset":protected] => string(5) "zh-cn"
476 ["param":protected] => array(0) {
477 }
478 ["get":protected] => array(0) {
479 }
480 ["post":protected] => array(0) {
481 }
482 ["request":protected] => array(0) {
483 }
484 ["route":protected] => array(0) {
485 }
486 ["put":protected] => NULL
487 ["session":protected] => array(0) {
488 }
489 ["file":protected] => array(0) {
490 }
491 ["cookie":protected] => array(0) {
492 }
493 ["server":protected] => array(0) {
494 }
495 ["header":protected] => array(11) {
496 ["host"] => string(18) "www.legend2.com:81"
497 ["connection"] => string(10) "keep-alive"
498 ["pragma"] => string(8) "no-cache"
499 ["cache-control"] => string(8) "no-cache"
500 ["upgrade-insecure-requests"] => string(1) "1"
501 ["user-agent"] => string(114) "Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36"
502 ["accept"] => string(85) "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"
503 ["referer"] => string(57) "http://www.legend2.com:81/index.php/index/task/index.html"
504 ["accept-encoding"] => string(13) "gzip, deflate"
505 ["accept-language"] => string(14) "en-US,en;q=0.9"
506 ["cookie"] => string(51) "muid=MQ%3D%3D; PHPSESSID=77keef8rc5vt93r8obgoc8e6g5"
507 }
508 ["mimeType":protected] => array(12) {
509 ["xml"] => string(42) "application/xml,text/xml,application/x-xml"
510 ["json"] => string(62) "application/json,text/x-json,application/jsonrequest,text/json"
511 ["js"] => string(63) "text/javascript,application/javascript,application/x-javascript"
512 ["css"] => string(8) "text/css"
513 ["rss"] => string(19) "application/rss+xml"
514 ["yaml"] => string(28) "application/x-yaml,text/yaml"
515 ["atom"] => string(20) "application/atom+xml"
516 ["pdf"] => string(15) "application/pdf"
517 ["text"] => string(10) "text/plain"
518 ["image"] => string(71) "image/png,image/jpg,image/jpeg,image/pjpeg,image/gif,image/webp,image/*"
519 ["csv"] => string(8) "text/csv"
520 ["html"] => string(35) "text/html,application/xhtml+xml,*/*"
521 }
522 ["content":protected] => NULL
523 ["filter":protected] => string(0) ""
524 ["bind":protected] => array(0) {
525 }
526 ["input":protected] => string(0) ""
527 ["cache":protected] => NULL
528 ["isCheckCache":protected] => NULL
529 }
530 ["failException":protected] => bool(false)
531 ["batchValidate":protected] => bool(false)
532 }

9、这里有很多个button,所以给button赋值id的方式找不到button?

用的php里面的循环,这样每一个button都是这样id,所以会错会找不到

二、内容在总结中

 

legend---五、如何优雅的实现多继承的更多相关文章

  1. javascript继承(五)—prototype最优两种继承(空函数和循环拷贝)

    一.利用空函数实现继承 参考了文章javascript继承—prototype属性介绍(2) 中叶小钗的评论,对这篇文章中的方案二利用一个空函数进行修改,可以解决创建子类对象时,父类实例化的过程中特权 ...

  2. JS面向对象组件(五) -- 复制对象(拷贝继承)

    研究到这儿,竟然出现了一个面试题目 var a = { name : '小明' }; var b = a; b.name = '小强'; alert( a.name ); 结果必然是“小强”,原因是对 ...

  3. JAVA笔记整理(五),JAVA中的继承

    1.继承的概念 继承是类与类的一种关系,是一种“is a”的关系 2.继承的好处 子类拥有父类的所有属性和方法,从而实现代码复用 4.方法的重写(Overridding) 如果子类对于继承自父类的方法 ...

  4. CSS中可以和不可以继承的属性

    一.无继承性的属性 1.display:规定元素应该生成的框的类型 2.文本属性: vertical-align:垂直文本对齐 text-decoration:规定添加到文本的装饰 text-shad ...

  5. day25、 静态属性、类方法、静态方法、组合、继承、

    一. 静态属性.类方法.静态方法 1.1静态属性 class Room: def __init__(self,name,owner,width,length): self.name=name self ...

  6. 编写一个可配置的网页信息提取组件 (二)—— 优雅的.net core 配置系统

    引言 在上篇文章(http://www.cnblogs.com/lightluomeng/p/7212577.html)中,初步实现了一个可配置的网页信息分析组件.但是由于是奔着解决事情的目的去的,所 ...

  7. 盘点CSS中可以和不可以继承的属性

    CSS中可以和不可以继承的属性   一.无继承性的属性 1.display:规定元素应该生成的框的类型 2.文本属性: vertical-align:垂直文本对齐 text-decoration:规定 ...

  8. CSS中可以继承和不可继承的常见属性

    一.无继承性的属性 1.display:规定元素应该生成的框的类型 2.文本属性: vertical-align:垂直文本对齐 text-decoration:规定添加到文本的装饰 text-shad ...

  9. Django 模本(Template--for--csrf--if--filter--simple_tag模版继承等)

    前提 关于html寻找路线: template 如果在各个APP中存在, Django 会优先找全局template 文件下的html文件,如果全局下的template文件没有相关的html  Dja ...

随机推荐

  1. How Javascript works (Javascript工作原理) (五) 深入理解 WebSockets 和带有 SSE 机制的HTTP/2 以及正确的使用姿势

    个人总结: 1.长连接机制——分清Websocket,http2,SSE: 1)HTTP/2 引进了 Server Push 技术用来让服务器主动向客户端缓存发送数据.然而,它并不允许直接向客户端程序 ...

  2. 如何使用外部插件picker

    近日有需求做一个职业选择弹框,在网上搜了半天也没合适的: 暴躁大佬协助我DIY一个插件,直接使用,顺滑流畅,随心所欲!特别鸣谢@一样菜 不多BB了,直接撸代码: 引用写在上面: /* 更改职业 */ ...

  3. Shiro结合Spring boot开发权限管理系统

    前一篇文章说了,我从开始工作就想有一个属于自己的博客系统,当然了,我想的是多用户的博客,大家都可以发文章记笔记,我最初的想法就是这样. 博客系统搭建需要使用的技术: 1.基于Spring boot 2 ...

  4. UVA-12083 Guardian of Decency 二分图 最大独立集

    题目链接:https://cn.vjudge.net/problem/UVA-12083 题意 学校组织去郊游,选择最多人数,使得任意两个人之间不能谈恋爱 不恋爱条件是高差大于40.同性.喜欢的音乐风 ...

  5. java 获取config 配置文件

    static ResourceBundle PropertiesUtil = ResourceBundle.getBundle("config"); public static S ...

  6. C语言数组和指针是不同的

    有一个这样的错误: 在一个文件中定义:int mango[100];  在另一个文件中声明:extern int *mango;  将会产生错误 定义和声明的区别: 在C中,任何对象都有且只有一个定义 ...

  7. LAMP环境搭建备忘 -- MariaDB 安装(三)

    因为 MySQL 的一些原因,在 Linux 平台上的开源数据库渐渐被 MariaDB 取代. MariaDB 安装命令如下图 安装成功后,接下来就启动这个数据库服务 我们还需要对数据库做一些初始化的 ...

  8. Django学习之配置篇

    MTV Model Template View 数据库 模版文件 业务处理 了解Django框架,功能齐全 一.安装Django&Django基本配置 安装Django pip3 django ...

  9. HDU——T 1507 Uncle Tom's Inherited Land*

    http://acm.hdu.edu.cn/showproblem.php?pid=1507 Time Limit: 2000/1000 MS (Java/Others)    Memory Limi ...

  10. Qt之QImageWriter

    简述 QImageWriter类为写入图像至文件或设备提供了一个独立的接口.QImageWriter支持格式特定的选项(如:质量和压缩率),可以在存储图像之前进行设置.如果不需要这些选项,可以使用QI ...