Yii2?? ? ?? ?? ?? ???? ???? ? ???? ? ?? ??? ??? ? ???? ????.
???: hasMany
???: hasOne (?? ??: yii tutorial)
?? ??: ? ? ???? ?? ??? ?? yiidbActiveQuery ?????
? ?? ????: ??? ??? ??? ??.
? ?? ????: ?????. ??? ?? ?? ??? ???? ?? ?? ??? ?????.
Association of Association
?? ??? ?? ?? ??? ?????
$customer = Customer::findOne(1); $orders = $customer->orders; // 通過在Customer中定義的關(guān)聯(lián)方法(getOrders())來獲取這個客戶的所有的訂單。
?? ? ?? ??? ??? ?? SQL ?? ?????
SELECT * FROM customer WHERE id=1; SELECT * FROM order WHERE customer_id=1;
Association ?? ??
??? ??? ????, we
$orders = $customer->orders;
? ?? ???? ?? ??? ???? ??? ??? ??? ?? ?? ? ????. ? ??? $customer->orders? ?? ??? ?? ??????? ???? ??? ???? ?? ????? sql? ???? ?? ?????.
?? ?? SQL? ???? ??? ??? ?? ????
unset($customer->orders); $customer->orders;
? ??? ?? ???????? ???? ??? ? ????.
?? ??:
// 執(zhí)行sql語句: SELECT * FROM customer WHERE id=1 $customer = Customer::findOne(1); //執(zhí)行sql:SELECT * FROM order WHERE customer_id=1 $orders1 = $customer->orders; //這個不會執(zhí)行sql,直接使用上面的緩存結(jié)果 $orders2 = $customer->orders; //如果中間的用戶訂單有變化,我們就不能從緩存中獲取,要unset掉 unset($customer->orders); $orders2 = $customer->orders;
? ??? yii2 ?? ?? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

yiiassetbundlesorganizeangeangeangeangeangeanagewebassetslikecss, javaScript, andimagesinayiiApplication.1

MVC ??? ???? ?? ????? ????? ?? ???? ?????? ??? ?? ??? ?????. ????? ?? ??? ???? ??? ????? ??? ??? ??? ????? ??? ???? ????. 1.?? ??? ???? ???? ?????? ??????. ?? ??, ???? Postscontroller? ?? ?? ?????? ??? Views/Posts/show.html.erb ?? views/posts/show.cshtml??????. 2. ?? ? ???? ???? ?? ? view ( 'posts.custom_template')?? Render'Custom_template '? ?? ??? ???? ??????.

TO TOREABASICROUTEINYII, FIRSTEPACONTROLLERBYPLACINGITINTECONTROLLERSDIRECTORYWITHPROPENAMINAMINAMINAMINAMINAMINATDEFINITIONEPTENDENDINGYII \ WEB \ CONTROLLER.1) CREATEANCACTIONSTATRINGWITH "ACTION"

Ayiideveloper'skeyErsponsibilitiesIngindingandimplementingFeatures, ApplicationSecurity, ? ??? ? ??? ???? QualificationSneedeDareastronggraspofpp, Experience-EndTechnologies, DatabasemanagementsKills ? Problem-Solvingabi

YII?? ??? ?? ??? ???? ??? ????? ???? ???? ???? ???? ???? ????? ?? ??? ???? ????. ?? ?? ??? ?? ???? ????? ?? ?????? JSON? ??????. ????? ??? ??? ?? ??? ?????. ?? ???? ??? ?????. 1. ???? ???? ????. 2. ??? ????? ??????. 3. URL ?? ????? ? ????. 4. ?? ??, ??? ?? ??, ???? ?? ?? ???? ???; 5. AccessControl ?? ?? ?? ??? ???? ???? ??????. ?? ??, ActionProfile ($ id)? /site /profile? id = 123? ?? ????? ??? ??? ???? ??? ? ? ????. ?? ??????

ayiidevelopercraftswebapplicationsingtheyiiiframework, ?? ?? Killsinphp, yii-specificknowledge ? webdevelopmentlifecyclemanagement.keySponsibilitiesInclude : 1) WritingEfficientCodetOptimizeperFormance, 2) poploitizingsecurityTopectAppplications,

touseactivercordinyifeffectively, ??? ??? ??? createamodelclassforeachtableandinteractwiththeabaseusingobject-orientedmethods.first, defineamodelclasseptendingyii \ db \ activerecordandspecorrecorrespecorrespectecorrespectedtablenaMeAblename ()

?? ??? ????, ?? ??? ??? ?????, ?????? ??? ????, ??? ??? ???? ????? YII?? ?? ???? ?? ? ? ????. ?? ??? ??? ????. 1. filetarget ?? dbtarget? ?? ?? ???? ?? ?? ??? ???? ??? '??'?? ?????. 2. yii :: info () ?? yii :: ?? ()? ???? ??? ???? ??? ????? (? : ??? ?? ? ???? ???)? ??? ?; 3. ????? ?? ? ??? ?? ??????? ??? ???? ?? ???? ???? ?? ??? ?? ??? ???????. 4. ???? ??? ?? ? ? ?? ?? ??? ?? ??? ???? ???? ??? ???? ??? ???? IP ? ??? ??? ?? ? ? ????. 5
