Home >Backend Development >PHP Tutorial >Cakephp 3.x (鍓嶈█涓轰粈涔堣浣跨敤浣跨敤妗嗘灦)

Cakephp 3.x (鍓嶈█涓轰粈涔堣浣跨敤浣跨敤妗嗘灦)

WBOY
WBOYOriginal
2016-06-13 12:29:071703browse

Cakephp 3.x (鍓嶈█-涓轰粈涔堣浣跨敤浣跨敤妗嗘灦)

鍦ㄨ鐮旂┒鐢熸椂鏈熼?変慨浜嗕竴闂╓eb Engineer鐨勮銆傚綋鏃惰绋嬫槸java servlet+ Tomcat + Mysql寮?鍙戜竴涓被浼糵acebook鐨勭ぞ浜ょ綉绔欍?傝璇剧殑鑰佸笀鎻愯捣杩囨鏋讹紝璇存鏋剁殑鐢ㄩ?斿湪浜庡噺灏戣嚜宸辨棭杞瓙鐨勬椂闂淬?傝?屽涔犳鏋舵垚鏈湪浜庤Documentation锛岄?氬父闇?瑕佷竴涓湀鐨勬椂闂村幓瀛︿範鎽哥储銆備絾鏄笉浠ヤ负鐒讹紝鑷繁寰掓墜鎼Н鏈ㄦ墠鏄叿鐐紝鎵嶇墰閫笺??br>
鐪熸鎺ヨЕ妗嗘灦杩欎釜涓滆タ锛岃繕鏄?015骞村垵锛屽垰鍒氬紑濮嬭繘鍏ュ伐浣溿?傚綋鏃朵娇鐢ㄤ簡鏇剧粡NXP瀹炰範鏈熼棿鍚潵鐨勪竴涓鏋禖akephp銆侰ake鏃╂湡鐨勬?濇兂鏄櫨鍒嗕箣鐧剧户鎵縍oR (Ruby on Rails)锛屾瘮濡俶igration銆乧ommand line銆傚綋鐒惰浜轰滑璇熺梾鐨勬槸Cake鏁版嵁灏佽妯″紡锛屽亸鍚戜簬鍏崇郴鍨嬫暟鎹簱銆傝櫧鐒禖akephp鍙兘娌℃湁Lavare閭d箞鐭ュ悕锛屼絾鏄牳蹇冨紑鍙戜汉鍛橈紝绀惧尯娲昏穬搴︿互鍙婇棶绛旂ぞ鍖虹殑闂渚濇棫寰堝銆?br>
瀵瑰垰鎺ヨЕ寤虹珯鐨勬湅鍙嬶紝Cakephp鐨勫紑鍙戝緢楂樻晥锛屾墿灞曟柟渚裤?備互鍙婂浜庡姳蹇楁垚涓烘瀯鏋跺笀鐨勭闉嬶紝闃呰Cakephp鏍稿績浠g爜鐨勫涔犱环鍊硷紝涓汉璁や负寰堥珮銆傚垵鏈熼?氳繃瀵笴akephp灏佽鐨凙PI浣跨敤锛屼簡瑙f櫘閫歁VC妗嗘灦鐨勫熀鏈ā鍧楀拰鍔熻兘銆傚湪杩涢樁鐨勮繃绋嬩腑锛岄槄璇绘牳蹇冧唬鐮侊紝浠庤?岀悊瑙e叾涓殑璁捐鍘熺悊銆傛渶鍚庨?氳繃浼樺寲浠g爜锛岃揪鍒拌瀺姹囪疮閫氱殑鍦版銆傜瑪鑰呬綔涓轰竴鍚嶅垵鍑鸿寘搴愮殑phper锛屽悓鏍蜂篃鍦ㄥ紑鍙戜腑鎽哥储鍜屽姫鍔涳紝甯屾湜涓鸿兘澶熼槄璇诲埌姝ゆ枃鐨勮鍚涙彁渚涜嚜宸辩殑鎵?鎬濇墍鎯筹紝涓庡悰涓?鍚岃繘姝ャ??br>
杩欎釜绯诲垪涓昏浠ョ炕璇慍akephp 3 Cookbook涓轰富锛岀潃閲嶄粙缁嶄娇鐢–akephp 3鐨勫紑鍙戦」鐩繃绋嬩腑鐨勪綋浼氾紝鍚屾椂绌挎彃浠嬬粛Cakephp 3鐨勭壒鐐广?傚笇鏈涢?氳繃浠嬬粛缈昏瘧Cakephp 3锛?涓篊akephp鍋氫竴浜涘皬灏忕殑璐$尞锛屼篃甯屾湜閫氳繃杩欎釜绯诲垪璁よ瘑蹇楀悓閬撳悎鐨勬湅鍙嬨??br>
鍦ㄨ繘鍏ョ粏鑺備箣闂达紝鎴戜滑鍏堜簡瑙e揩閫熺殑璁茶堪涓?浜汣akephp 3鐨勫姛鑳姐??br>
1). 鍛藉悕绾﹀畾锛圢aming Conventions锛?br>Cake锛屽鍚孯oR锛孌jango绛夋鏋讹紝鎻愪緵涓?濂楀畬鏁碝VC绾﹀畾鍚嶇О銆備娇鐢ㄥ懡鍚嶇害瀹氾紝鍙互渚垮埄鍦颁娇鐢–ake鎻愪緵鐨勪竴浜涘姛鑳姐?傚悓鏃跺浜庨」鐩箣鍚庝唬鐮佺殑缁存姢涔熸湁甯姪銆傚浜庡紑鍙戣繃绋嬶紝鍛藉悕绾﹀畾鏈夊姪浜庡紑鍙戞晥鐜囥??br>
2). 鏁版嵁灞傦紙Model锛?br>Cakephp 3鐨勬暟鎹眰鐩歌緝浜嶤akephp 2锛屾湁浜嗘槑鏄剧殑鎻愬崌銆備笉浠呮敮鎸丮YSQL锛孭ostgreSQL锛孧icrosoft SQL Server锛孲QLite绛夛紝鍚屾椂ORM鎻愪緵涓ょ涓嶅悓鐨勬暟鎹瓹RUD API銆備娇鐢ㄨ?呭彲浠ヤ娇鐢ㄥ師鐢熺殑SQL璇彞璋冪敤鏁版嵁搴擄紝鐏垫椿鍦板鐞唓uery銆侲ntity澶勭悊绫绘彁渚涗竴濂楀皝瑁呯殑API锛屼娇鐢ˋPI鍙互瀹夊叏鍦板鐞嗘暟鎹??br>
3). 瑙嗗浘灞傦紙Views锛?br>瑙嗗浘灞傛彁渚涘熀鏈殑鏁版嵁灞曠幇銆傛ā鏉夸互鍙婃墿灞曟ā鍧楅珮鏁堝湴绠?鍖栦唬鐮侊紝浣垮墠绔唬鐮佹洿鍔犵畝娲侊紝鍙互閲嶅鍒╃敤銆傚悓鏃惰鍥惧眰鎻愪緵浜嗗畬澶囩殑RESTFUL搴旂敤锛屽寘鎷琗ML锛孞SON绛夎祫婧愶紝鍙互閫氳繃URI鐨勫舰寮忥紝涓虹綉绔欐彁渚泈eb server銆?br>
4). 鎺у埗灞傦紙Controllers锛?br>鎺у埗灞備綔涓烘牳蹇冮?昏緫灞傦紝鏈夋晥鐨勬槸鏁版嵁灞傚拰瑙嗗浘灞傜粨鍚堣捣鏉ャ?傞噸瑕佺殑绠楁硶澶勭悊锛屽彲浠ュ湪杩欎釜灞傚疄鐜板拰瀹屽杽銆?br>



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn