Yi i Framework

Embed Size (px)

Citation preview

  • 8/12/2019 Yi i Framework

    1/64

    HTTP://SEODRUPAL.VNLp trnh Drupal, Zend ra!e"#r$, %&& ra!e"#r$

    Kim tra tng thch gia Yii vi my chhttp://yourhostname/path_to_yii/requirements/ine!"phphttp://#oca#host/so$tvn/requirements/ine!"php%h&n m'm ch(y #oca#: )ampp* +amp* ,o n-n .ng appserv v 01 #2i3 nguy-n nh4n mnh ,o 0i5t* t6tnh7t n-n trnh8"9oc !;i #u ?i'u ,i@n"

    '. (hu)n *+Arc ti-n 0(n phBi c7u hnh CinoCs ? sD Eng ?Fc php vi cm

    GHiB sD 0(n c;i apache mc ?1nh tr-n +in)% 3I:J!amppJhtocs8"

    G(n thi5t #=p #(i 0i5n m !o 0Z cc ?Lng [n ?\ t]n t(i trongte!t0o! m; ng^n cch chng vi nhau 0Ong 7u ``"

    GAi5p ?> 0(n th-m v;o nhng ?Lng [n sau: `I:J!amppJphp` v; `

    I:J!amppJhtocsJyiiJ$rameCor,`" Wu X sDa ?Lng [n cho ph. hFp vi my 0(n nha "

    GKhbi ?ng my tnh #(i".T-# n d0n %&& !1&GYiidoot #; th mEc ni 0(n ?\ c;i ?t Yii

    http://seodrupal.vn/http://yourhostname/path_to_yii/requirements/index.phphttp://localhost/softvn/requirements/index.phphttp://seodrupal.vn/http://yourhostname/path_to_yii/requirements/index.phphttp://localhost/softvn/requirements/index.php
  • 8/12/2019 Yi i Framework

    2/64

    G+e0root #; th mEc g>c cha Ce0GA fng #@nh* ?5n Ce0root ca 0(n v; thc hi@n:(:J(d2(d (:23a!pp2htd#452(:23a!pp2htd#45265#7t8n/7ra!e"#r$/9&&4 "e*app de!#de!#;e* appl&4atn under ?/>e*r##t/de!#?@ %e5N#;

    %e59;N=y #; ,hung !ng ca Yii ?\ ?Fc t(o ra th;nh c th truy c=p v;o ng Eng t trnh uy@thttp://#oca#host/emo/ine!"phpcopy $rameCor, sang emo"N;o $i#e ine!"php thay ?i ?Lng [n th;nh : yiijirname3__klWM__8"/$rameCor,/yii"php

    BBB. T-# 4#ntr#llerGN;o th mEc ng EngR\:c /+e0root/emo

    I:/I I:/!ampp/htocs/emo

    GKhbi ?ng Yii Phe##R\:Yiidoot/$rameCor,/yiic she##

    I I:/!ampp/htocs/emoI:/!ampp/htocs/emoQ I:/!ampp/htocs/so$tvn/$rameCor,/yiic she##

    A(o thD contro##er t-n message c> h;nh ?ng #; he##o+or#I php: contro##er contro##erGlQ actionGlN:

    R\:contro##er message he##o+or#

    GRessageIontro##er ?\ ?Fc t(o th;nh c n> cng t(o ra vieC t(i th mEc: protecteJvieCsJmessageGIhng ta cng c> th truy c=p v;o h;nh ?ng he##o+or# t trnh uy@te$au#t: http://#oca#host/emo/ine!"phprjmessage GQ ch(y v;o ine!http://#oca#host/emo/ine!"phprjmessage/he##o+or#

    http://localhost/demo/index.phphttp://localhost/demo/index.php?r=messagehttp://localhost/demo/index.php?r=message/helloWorldhttp://localhost/demo/index.phphttp://localhost/demo/index.php?r=messagehttp://localhost/demo/index.php?r=message/helloWorld
  • 8/12/2019 Yi i Framework

    3/64

    VBBB. T-# l&=n $CtGYii c> h2 trF sn h;m t(o #i-n ,5t trong c#ass I9tm#GN:A(o #i-n ,5t ti NieC goo0yeR\:pQphp echo I9tm#::#in,3`Hoo0ye`*array3message/goo0ye88 Q/pQA(o #i-n ,5t ti NieC 9e##oR\:pQphp echo I9tm#::#in,3`9e##o`*array3message/he##o+or#88 Q/pQ

    B.(& FGt data*a5e'.%&& h trI 4J4 dala*a5e 5au:GRyPW w"x or #aterG%ostgresPW U" or #aterGPWite z an GRicroso$t PW Perver z{{{ or #aterG|rac#e. KCt n& 81& data*a5e

    GAhc hi@n b $i#e /protecte/con$ig/main"phpGRc ?1nh n> ?ang ,ch ho(t ?fng n;y #; ata0ase ca ,hung !ng Yii

    R\: 0jQarray3 connectionPtring jQ sq#ite:"irname3__klWM__8"/""/ata/testrive"0* 8*

    G HiB sD ta c> x 0Bng trong Rysq# nh sau:

    R\:IdMTAM ATWM lk }|A M)lPAP ~t0#_user~ 3

    ~i~ int3xx8 }|A }WW TA|_l}IdMRM}A* ~username~ varchar3xz8 }|A }WW* ~passCor~ varchar3xz8 }|A }WW* ~emai#~ varchar3xz8 }|A }WW* %dlRTdY KMY 3~i~88

    G Ihng ta phBi ,ch ho(t ?fng sau trong /protecte/con$ig/main"php ? ,5t n6i vi Rysq# 30Z / / v;sDa #(i c7u hnh8

    R\:

    // uncomment the $o##oCing to use a RyPW ata0ase0jQarray3

    connectionPtring jQ mysq#:hostj#oca#host0namej0_yii* emu#ate%repare jQ true* username jQ root* passCor jQ * charset jQ ut$* 8*

    G}go;i ra ta c> th ,5t n6i vi ci ata0ase ,hc 3thay ?i fng connectionPtring8 PWite: sq#ite:/path/to/0$i#e RyPW: mysq#:hostj#oca#host0namejtest0

  • 8/12/2019 Yi i Framework

    4/64

    %ostgrePW: pgsq#:hostj#oca#hostportjwz0namejtest0 PW Perver: mssq#:hostj#oca#host0namejtest0 |rac#e: oci:0namej//#oca#host:xzx/test0

    B. T-# (RUDG Id #; cc chc n^ng create* rea* upate v; e#ete x 0Bng trong ata0ase

    '. KM4h h#-t 4n 40 &&G Hii h2 trF sinh m\ t ?ng cc chc n^ng nh Iontro##er* Iru* korm* Roe#* Rou#e"G ,ch ho(t Hii ta v;o $i#e con$ig /protecte/con$ig/main"phpG Kch ho(t ?o(n coe sau

    R\: // uncomment the $o##oCing to ena0#e the Hii too# giijQarray3 c#assjQsystem"gii"HiiRou#e* passCorjQxzw* // l$ remove* Hii e$au#ts to #oca#host on#y" Mit care$u##y to taste" ipki#tersjQarray3xzU"{"{"x*::x8*

    8*

    G i passCor mi ? ?^ng nh=p HiiG N;o Hii th

  • 8/12/2019 Yi i Framework

    5/64

    G I#ic, v;o cc chc n^ng nh Ireate ser* Ranage ser* n> s 0t ta ?^ng nh=p* ta c> th sD Enguser v; pass sau: emo/emo 3t;i ,hoBn 0nh thLng8 hay amin/amin 3t;i ,hoBn amin8G Ni t;i ,hoBn amin ta c> th truy c=p v;o trang quBn #X sauhttp://yourhostname/emo/ine!"phprjuser/amin" dW Ah4n thi@nN;o protecte/con$ig/main"php 0Z comment ur#Ranager""yiijirname3__klWM__8"/$rameCor,/yii"php

    BB (( TRN D LBWU TRON ORthisGQpageAit#ejAhay ?i ti-u ?' trang t(i ?4y(J4h ': DXn 7#r! *Yn 4J4h dXn "&det.//Khbi t(o Ciget sD Eng Ta! cho korm Tctive

    $ormjthisGQ0egin+iget3ITctivekorm*arra93ijQuserG$orm*ena0#eTa!Na#iationjQtrue*ena0#eI#ientNa#iationjQtrue*$ocusjQarra93moe#*name8

    88php//Kim tra ?&u v;o moe# ?\ ?ng cha

    e4h# $ormGQerrorPummary3moe#8Qivc#assj"row"Q

    php//Khbi t(o trLng namee4h# A-n truy c=p:e4h# $ormGQte!tkie#3moe#*name8e4h# $ormGQerror3moe#*name8

    Q/ivQ

    Th=! (apt4ha 4h# 7#r!G}5u cha 0=t `gz` th ta v;o $i#e php"ini r]i sa #(i fng n;yR\ %9%:e!tensionjphp_gz"##php thisGQCiget3IIaptcha*array3 0uttonWa0e# jQ W7y coe mi* c#ic,a0#elmage jQ true* image|ptions jQ array3i jQ captchaimg8 88 QRE: ( [\n; T-# 7#r! tr#n 8&e")em th-m cc Retho ? a cc kie# ,hc cho $orm 9ere}go;i cch .ng ITctivekorm ta c> th .ng Ihtm# t(o $orm: I9tm#

    Ni5t W(i $orm tr-n 0Ong cch .ng I9tm#:R\ %9%:iv ij$ormQ

    phpecho I9tm#::0eginkorm38

    Q iv ijroCQ php echo I9tm#::activeWa0e#3moe#*name8Q 0r/Q php echo I9tm#::activeAe!tkie#3moe#*name8Q /ivQ iv ijroCQ php echo I9tm#::activeWa0e#3moe#*emai#8Q 0r/Q php echo I9tm#::activeAe!tkie#3moe#*emai#8Q /ivQ

    http://yourhostname/demo/index.php?r=user/adminhttp://www.yiiframework.com/doc/api/1.1/CActiveFormhttp://www.yiiframework.com/doc/api/1.1/CHtmlhttp://yourhostname/demo/index.php?r=user/adminhttp://www.yiiframework.com/doc/api/1.1/CActiveFormhttp://www.yiiframework.com/doc/api/1.1/CHtml
  • 8/12/2019 Yi i Framework

    6/64

    iv ijroCQ php echo I9tm#::activeWa0e#3moe#*pass8Q 0r/Q php echo I9tm#::active%assCorkie#3moe#*pass8Q /ivQ iv ijroCQ php echo I9tm#::activeWa0e#3moe#*repass8Q 0r/Q php echo I9tm#::active%assCorkie#3moe#*repass8Q /ivQ

    iv ijroCQ php echo I9tm#::activeWa0e#3moe#*ate8Q 0r/Q php echo I9tm#::activeAe!tkie#3moe#*ate8Q /ivQ iv ijsenQ 0r/Q php echo I9tm#::su0mitutton3^ng KX*array3ijQ$rmdeg*namejQ$rmdeg88Q /ivQphp

    echo I9tm#::enkorm38Q/ivQ

    Pau ,hi t(o $orm !ong th ti 0c ti5p theo #; a cc r;ng 0uc cho th

  • 8/12/2019 Yi i Framework

    7/64

    gi6ng nh hnh #; #oa r]i* n> v;ng hay ?Z th !em #(i c7u hnh Ce0server

    G}5u cha 0=t `gz` th ta v;o $i#e php"ini r]i sa #(i fng n;yR\ %9%:e!tensionjphp_gz"##0Z 7u `` trc n>* m7y ci ,hc ? e$aut ?ng ty my* restar Ce0server v; test #(i* n5u v[n #2i GGQ th #;nh

    G t(o captcha ta th-m v;o ph&n vieC ?o(n coe sau:R\ %9%:php thisGQCiget3IIaptcha*array3 0uttonWa0e# jQ W7y coe mi* c#ic,a0#elmage jQ true* image|ptions jQ array3i jQ captchaimg8 88 Q

    Ni: 0uttonWa0e# : hin th1 mt #in, vi ni ung m; ta set* ,hi c#ic, v;o ?> s ?Zi string c.a captcha c#ic,a0#elmage: ,hi c#ic, v;o image s ?i sang hnh ,hc" image|ptions: set cc thuc tnh 9tm# ca captcha

    G Rt captcha ?Fc renere 0bi mt h;nh ?ng ca #p IIaptchaTction* o ?> n5u ch a 0-nvieC s ,h

  • 8/12/2019 Yi i Framework

    8/64

    Iu6i c.ng ra ci $orm nh v&y:

    G r;ng 0uc cc th

  • 8/12/2019 Yi i Framework

    9/64

    Sb d0n BB 3c9 dn Pr#e4t AR 4la55Wu X: sau t-n #oca#host #; t-n $o#er Ce0site ca 0(n* vui #fng thay th5 cho ?ng"http://#oca#host/trac,star/ine!"phprjgii"

    T-# !1& ' 4la55 !#del t*lfpr#e4t ta*le, the#del enerat#r a ngo;i #i-n ,5t trb #(i vi 0Bng3t0#_user8"

    oNH NHA (( qB UAN HWRt n c> th c> nhi'u ngLi sD Eng truy c=p* v; ngLi truy c=p c> th #i-n ,5t vi nhi'u

    n chng ta gVi ?> #; #i-n ,5t nhi'u nhi'u 3many to many 8"Ich thc t6t nh7t ? m< hnh h>a quan h@ nhi'u nhi'u 3manyGtoGmany8 trong cc #i@u

    #i-n quan ?> #; sD Eng s ,5t hFp 3association8 hoc ph4n quy'n cho 0Bng 3ta0#e8"i ?4y #; m< hnh c 0Bn thc th quan h@ gia ngLi sD Eng 3users8* n3proect8* v;

    sBn phm 3issues8" Rt n c> th c> hoc ,h nhi'u ngLi .ng*" Rt ngLi sD Engc&n phBi ,5t hFp vi t nh7t mt n* hoc c> th ,5t hFp vi nhi'u n" PBn phm s chthuc v' mt v; ch uy nh7t mt n" Khi ?> mt n c> th c> ,h

  • 8/12/2019 Yi i Framework

    10/64

    Rt sBn phm ?Fc ph4n quy'n 3hay ?Fc y-u c&u8 0bi uy nh7t x ngLi .ng"

    M!act#y one: Ih uy nh7t x"x or Rore : Rt hoc nhi'u{ or Rore : Kh

  • 8/12/2019 Yi i Framework

    11/64

    upate_time TAMAlRM*upate_user_i l}AMHMd8 M}Hl}M j lnnoIdMTAM ATWM lk }|A M)lPAP t0#_proect_user_assignment3proect_i lnt3xx8 }|A }WW*user_i lnt3xx8 }|A }WW*create_time TAMAlRM*create_user_i l}AMHMd*upate_time TAMAlRM*upate_user_i l}AMHMd*%dlRTdY KMY 3proect_i*user_i88 M}Hl}M j lnno

    T-# 4J4 !& vuan hj:GA(o ,h>a ngo(i gia z 0Bng t0#_issue*t0#_proect tham chi5u 3i thuc 0Bng t0#_proect8 n6i viproect_i trong 0Bng t0#_issue"

    TWAMd ATWM t0#_issue T I|}PAdTl}A kK_issue_proect k|dMlH} KMY 3proect_i8dMkMdM}IMP t0#_proect 3i8 |} MWMAM ITPITM |} %TAM dMPAdlIAGA(o ,h>a ngo(i gia z 0Bng t0#_issue* t0#_user tham chi5u 3i thuc 0Bng t0#_user8 n6i vioCner_i 3,h>a 0Bn th4n8 trong 0Bng t0#_issue"

    TWAMd ATWM t0#_issue T I|}PAdTl}A kK_issue_oCner k|dMlH} KMY 3oCner_i8dMkMdM}IMP t0#_user 3i8 |} MWMAM ITPITM |} %TAM dMPAdlIAAng t vi cc ,h>a ngo(i cfn #(i:

    TWAMd ATWM t0#_issue T I|}PAdTl}A kK_issue_requester k|dMlH} KMY3requester_i8 dMkMdM}IMP t0#_user 3i8 |} MWMAM ITPITM |} %TAM dMPAdlIA

    TWAMd ATWM t0#_proect_user_assignment T I|}PAdTl}A kK_proect_user k|dMlH}KMY 3proect_i8 dMkMdM}IMP t0#_proect 3i8 |} MWMAM ITPITM |} %TAMdMPAdlIA

    TWAMd ATWM t0#_proect_user_assignment T I|}PAdTl}A kK_user_proect k|dMlH}KMY 3user_i8 dMkMdM}IMP t0#_user 3i8 |} MWMAM ITPITM |} %TAM dMPAdlIA

    T-# A4t&8e Re4#rd #del 4la55e5 4h# 4J4 *\n 8wa t-#:

  • 8/12/2019 Yi i Framework

    12/64

    A(o h;m trB v' mBng cha cc thuc tnh:

    pu0#ic $unction getAype|ptions38return array3se#$::AY%M_HjQug*se#$::AY%M_kMTAdMjQkeature*se#$::AY%M_ATPKjQAas,*

    8

    Th=! !xt 7&lter g*x ly4mRb protecte/contro##ers/lssueIontro##er"php th-m ni ung sau v;o i #p:

    pu0#ic $unction $i#ter%roectIonte!t3$i#terIhain8$i#terIhainGQrun38

    Ah-m c7u hnh cho $i#ter v;o mBng c7u hnh"Ni $i#ter mi ?Fc ?1nh ngha ta thD p Eng vi createaction"39;m t(o8"

    pu0#ic $unction $i#ters38return array3accessIontro#* // per$orm access contro# $or Id operations?pr#e4t(#nte3t z 4reate?, //chec, to ensure va#i proect conte!t8

    %hng thc tr-n s trB v' c7u hnh cho $i#ter proectIonte!t ci m; chng ta ?\ ?1nh ngha gi6ng

    nh mt phng thc trong c#ass v; n> p Eng cho actionIreate38 metho" I php c7u hnhcho php #; : hoc 7u G ,X hi@u ?c 0i@t ?Fc sD Eng ,hi chng ta mu6n hoc ,h ?Fc p Eng hay ,h thc hi@n metho actionIreate38Auy nhi-n chng ta cha thc hi@n ?Fc s #ogic c&n thi5t"Ihng ta mu6n chc chn rOng v^

    0Bn n ?Fc thc hi@n trc ,hi cc h;nh ?ng 3action8 ?Fc ,ic, ho(t"Ihng ta c&n ?t $i#ter

    #ogic trc ,hi gVi $i#terIhainGQrun38"(h{n ta 5| 5b d0n 4hu& tw $h]a gvuer95tr&nm l !xt tha! *&Cn n#& URL F}I4 trnh *9F^ nhn d-n 4J4 d Jn gpr#e4tm.

    Ic preGaction ca ki#ter s ,im tra ? nh=n 0i5t"}5u cc thuc tnh ca n hi@n t(i #;}WW* chng ta s sD Eng chu2i t ,h>a3querystring8 tham 0i5n ? ,ch ho(t s #a chVn cc nc 0Bn trong ,h>a chnh ?Fc nh=n (ng 3%rimary Key inenti$ier8" }5u th;nh c

  • 8/12/2019 Yi i Framework

    13/64

    / var private property containing the associate %roect moe# instance"/private _proect j nu##/ %rotecte metho to #oa the associate %roect moe# c#ass proect_i the primary ienti$ier o$ the associate %roect return o0ect the %roect ata moe# 0ase on the primary ,ey

    /protecte $unction #oa%roect3proect_i8 //i$ the proect property is nu##* create it 0ase on input ii$3thisGQ_proectjjjnu##8thisGQ_proectjlssue::moe#38GQ$in0y%,3proect_i8i$3thisGQ_proectjjjnu##8throC neC I9ttpM!ception3w{w*Ahe requeste proect oes not e!ist"8

    return thisGQ_proect/ lnGc#ass e$ine $i#ter metho* con$igure $or use in the a0ove $i#ters38 metho lt is ca##e 0e$ore the actionIreate38 action metho is run in orer to ensure a proper proectconte!t/pu0#ic $unction $i#ter%roectIonte!t3$i#terIhain8//set the proect ienti$ier 0ase on either the HMA or %|PA input//request varia0#es* since Ce a##oC 0oth types $or our actionsproectl j nu##i$3isset3_HMApi88proectl j _HMApie#sei$3isset3_%|PApi88proectl j _%|PApithisGQ#oa%roect3proectl8//comp#ete the running o$ other $i#ters an e!ecute the requeste action$i#terIhainGQrun38

    """

    TH~ PROE(T BD

    Wi-n ,5t3 #in,8 chng ta c&n ?i'u chnh trong vieC $i#e : /protecte/vieCs/issue/ine!"php"

    ?&u trang chng ta s nhn th7y #in, create neC "

  • 8/12/2019 Yi i Framework

    14/64

    thisGQmenujarray3arra9g?la*el?6?(reate B55ue?, ?url?6arra9g?4reate?mm,array3#a0e#jQRanage lssue* ur#jQarray3amin88*8

    Ihng ta th-m trLng pi va t(o :array3#a0e#jQIreate lssue* ur#jQarray3create* pijQx88*

    Aruy c=p #(i v;o amin v; c#ic, v;o #in, #i-n ,5t : http://#oca#host/emo/ine!"php

    rjissue/createpijx" Aa ?\ thc hi@n ?Fc"

    &u 4hnh 4h& t&Ct twn tran 4a d Jn:Ah-m m\ n cho tng dW cho vi@c t(o mi sBn phm #; mt giai ?o(n ,h t6t ? chc chn rOngnhng ?i'u chnh 0-n ngo;i #;m vi@c mt cch ho;n hBo"Auy nhi-n* chng ta c> mt v7n ?' !By ra vm\ coe #; proectl #u

  • 8/12/2019 Yi i Framework

    15/64

  • 8/12/2019 Yi i Framework

    16/64

    / deturns the proect moe# instance to Chich this issue 0e#ongs/pu0#ic $unction get%roect38return thisGQ_proect

    Rb /protecte/vieCs/issue/_$orm"php v; tm trong $orm cc trLng oCner_i* requester_iAhay th5: php //echo $ormGQte!tkie#3moe#*oCner_i8 Q

    th;nh

    php echo $ormGQropoCnWist3moe#*oCner_i*moe#GQproectGQgetser|ptions388 Q

    Ahc hi@n thay th5:php echo $ormGQte!tkie#3moe#*requester_i8 Q

    Arb th;nh:

    php echo $ormGQropoCnWist3moe#*requester_i* thisGQget%roect38GQgetser|ptions388

    Qdemove cc trLng sau:

    iv c#assj`roC`Qphp echo $ormGQ#a0e#M!3moe#*create_time8 Qphp echo $ormGQte!tkie#3moe#*create_time8 Qphp echo $ormGQerror3moe#*create_time8 Q/ivQiv c#assj`roC`Qphp echo $ormGQ#a0e#M!3moe#*create_user_i8 Qphp echo $ormGQte!tkie#3moe#*create_user_i8 Q

    php echo $ormGQerror3moe#*create_user_i8 Q/ivQiv c#assj`roC`Qphp echo $ormGQ#a0e#M!3moe#*upate_time8 Qphp echo $ormGQte!tkie#3moe#*upate_time8 Qphp echo $ormGQerror3moe#*upate_time8 Q/ivQiv c#assj`roC`Qphp echo $ormGQ#a0e#M!3moe#*upate_user_i8 Qphp echo $ormGQte!tkie#3moe#*upate_user_i8 Q

    php echo $ormGQerror3moe#*upate_user_i8 Q/ivQ

    Aruy c=p v;o issue vi acc:emo !em thD ph&n create action38

    THA% B PROE(T (ONTROLLERTr}14 t&=n F&u 4hnh a4tnV&e"gm tr#n 4la55 Pr#e4t (#ntr#ller &n nh} 4h{n ta !untr}n *9 danh 5J4h 5\n ph)! l&=n vuan FCn 4J4 d Jn FG4 *&jt.(h{n ta 4] th^ l! F&u n9tr#n !xt 8& tran &n nh} tran 4h& t&Ct.Ph}n th4 A4tn V&e"gm l !eth#d F}I4 dXnF^ h&^n th+ 4h& t&Ct 5\n ph)!.

    &u 4hnh !eth#d nh} 5au:/

  • 8/12/2019 Yi i Framework

    17/64

    D&5pla95 a part&4ular !#del./pu*l&4 7un4tn a4tnV&e"gm&55ueDataPr#8&derne" (A4t&8eDataPr#8&derg?B55ue?, arra9g?4r&ter&a?6arra9g?4#nd&tn?6?pr#e4tf&d:pr#e4tBd?,?para!5?6arra9g?:pr#e4tBd?6th&5 b ?4y ? trng 0;ysBn phm trong trang chi ti5t ca n"

    Ihng ta cng phBi thay ?i /protecte/vieCs/issue/_vieC"php sD Eng temp#ate #ayout cho sBn phm,hc" i'u chnh ni ung thc th sau:

    iv c#assj`vieC`Q0Qphp echo I9tm#::encoe3ataGQgetTttri0uteWa0e#3name88 Q:/0Qphp echo I9tm#::#in,3I9tm#::encoe3ataGQname8* array3issue/vieC* ijQataGQi88 Q0r /Q0Qphp echo I9tm#::encoe3ataGQgetTttri0uteWa0e#3escription88 Q:/0Qphp echo I9tm#::encoe3ataGQescription8 Q0r /Q0Qphp echo I9tm#::encoe3ataGQgetTttri0uteWa0e#3type_i88 Q:/0Q

  • 8/12/2019 Yi i Framework

    18/64

    php echo I9tm#::encoe3ataGQtype_i8 Q0r /Q0Qphp echo I9tm#::encoe3ataGQgetTttri0uteWa0e#3status_i88 :/0Qphp echo I9tm#::encoe3ataGQstatus_i8 Q/ivQ

    A(i %roect Iontro##er PDa ?i WoaRou#eprivate _moe#

    pu0#ic $unction #oaRoe#38

    i$3thisGQ_moe#jjj}WW8 i$3isset3_HMAi88

    thisGQ_moe#j%roect::moe#38GQ$iny%,3_HMAi8i$3thisGQ_moe#jjjnu##8

    throC neC I9ttpM!ception3w{w*Ahe requeste page oes not e!ist"8

    return thisGQ_moe#

    Ah-m #i@u v;o 0-n issue/create t(o mi z 0Bn ghi"Kim tra ,5t quB : 3http://#oca#host/tasctra,/ine!"phprjproect/vieCijx8

    H&^n th+ 4J4 Statu5 8 T9pe te3t tr#n BSSUEV# :/protecte/moe#s/lssue"php

    pu0#ic $unction getPtatusAe!t38status|ptionsjthisGQstatus|ptionsreturn isset3status|ptionsthisGQstatus_i8 status|ptionsthisGQstatus_i : `un,noCn status3thisGQstatus_i8`

    / return string the type te!t isp#ay $or the current issue/pu0#ic $unction getAypeAe!t38type|ptionsjthisGQtype|ptionsreturn isset3type|ptionsthisGQtype_i8 type|ptionsthisGQtype_i : `un,noCn type 3thisGQtype_i8`

    TH~ O_N HBN THo TET tw #r!N;o : /protecte/vieCs/issue/_vieC"php:

    Ahay ?i :php echo I9tm#::encoe3ataGQtype_i8 Qth;nhphp echo I9tm#::encoe3ataGQgetAypeAe!t388 QN; thay ?iphp echo I9tm#::encoe3ataGQstatus_i8 Qthis:php echo I9tm#::encoe3ataGQgetPtatusAe!t388 Q

    THA% B (HB TBT VBE> BSSUE

  • 8/12/2019 Yi i Framework

    19/64

    :/pr#te4ted/8&e"5/&55ue/8&e".phpTh=! F#-n 5au:@php th&5

  • 8/12/2019 Yi i Framework

    20/64

    &7g&55etgfET?B55ue?;mm!#del

  • 8/12/2019 Yi i Framework

    21/64

    8*array3namejQstatus_i*va#uejQI9tm#::encoe3moe#GQgetPtatusAe!t3888*arra9g?na!e?6?#"nerf&d?,?8alue?6(Ht!l::en4#deg!#del mt n cE th"I> nhng #i-n ,5t hnh th;nh t trang chi ti5t sBn phm 3issue8 v; ?c 0i@t sBn phm ?> c> n #i-nquan* chng ta c> th 0t ?&u chnh #(i #i-n ,5t ?Fc nh7n trong proectl v; proectl n;y nOm tronglssueIontro##er::ine! v; lssueIontro##er::actionTmin metho"

    Rb ?Lng [n: /protecte/vieCs/issue/vieC"php thay ?i c7u hnh menu:

    thisGQmenujarray3arra9g?la*el?6?L&5t B55ue?, ?url?6arra9g?&nde3?, ?p&d?6!#del

  • 8/12/2019 Yi i Framework

    22/64

    dataPr#8&derne" (A4t&8eDataPr#8&derg?B55ue?, arra9g?4r&ter&a?6arra9g?4#nd&tn?6?pr#e4tf&d:pr#e4tBd?,?para!5?6arra9g?:pr#e4tBd?6th&5

  • 8/12/2019 Yi i Framework

    23/64

    Khi chng ta sD Eng c

  • 8/12/2019 Yi i Framework

    24/64

    ?4y chng ta ?ang ghi ? phng thc Iactivedecor::0e$oreNa#iate38"4y #; phng thc gipngLi sD Eng c> th t.y 0i5n qu trnh truy c=p"n5u 0(n ,h hai phng php ti5p !c cho php chng ta ? ,hai thc cc c

  • 8/12/2019 Yi i Framework

    25/64

    iv c#assj`roC`Qphp echo $ormGQ#a0e#M!3moe#*#ast_#ogin_time8 Qphp echo $ormGQte!tkie#3moe#*#ast_#ogin_time8 Qphp echo $ormGQerror3moe#*#ast_#ogin_time8 Q/ivQ

    chng ta cng n-n #o(i 0Z cc quy tc !c nh=n quy ?1nh cho cc trLng n;y trong cc metho quytc #i-n quanArong metho ser::ru#es38 metho* !>a ?i z ru#es sau:

    array3create_user_i* upate_user_i* numerica#* integer|n#yjQtrue8*array3#ast_#ogin_time* create_time* upate_time* sa$e8*

    W;m tng t vi z moe# cfn #(i #; :proect* issue" )>a 0Z cc trLng #i-n quan ti #i@u va !>a"

    Ah-m trLng !c thc m=t ,hu:Ah-m #-n 0-n ?&u trang user:

    pu0#ic passCor_repeat

    ser::ru#es38 metho th-m :

    array3passCor* compare8*

    array3passCor_repeat* sa$e8*

    N;o protecte/vieCs/user/_$orm th-m trLng nh=p #(i m=t ,hu :

    iv c#assj`roC`Qphp echo $ormGQ#a0e#3moe#*passCor_repeat8 Qphp echo $ormGQpassCorkie#3moe#*passCor_repeat*array3siejQ{*ma!#engthjQz88 Qphp echo $ormGQerror3moe#*passCor_repeat8 Q/ivQ

    R\ h>a m=t ,hu:Rb Ihec,serTctivedecor trong protecte/moe#s/ v; thc hi@n:

    /

    per$orm oneGCay encryption on the passCor 0e$ore Ce store it in the ata0ase/protecte $unction a$terNa#iate38parent::a$terNa#iate38thisGQpassCor j thisGQencrypt3thisGQpassCor8pu0#ic $unction encrypt3va#ue8return m3va#ue8

    ( TH( USER 5b d0n DATA[ASEHii thi@u Yii authentication moe##; mt th;nh ph&n ng Eng* ngLi sD Eng* trong ?>* trong trLng hFp chung nh7t* #; mt ?6i tFngthc hi@n giao i@n l+e0ser" Ic #p hVc cE th ?Fc sD Eng 0Ong cch thc hi@n mc ?1nh cachng t

  • 8/12/2019 Yi i Framework

    26/64

    8*

    N n> #; c7u hnh nh mt th;nh ph&n ng Eng* vi ,ey3user8 * chng ta c> th truy c=p n> b 07t ,ni n;o trong su6t ng Eng ca chng t #; true cho php th mt t;i ,hoBn Hhi nh hp ,imtr-n cc hnh thc ?^ng nh=p ?* n5u ngLi .ng #a chVn* hV c> th ?Fc t ?ng ?^ng nh=p v;ong Eng ,hi #&n gh th^m sau ? v;o trang Ce0"Khung !c thc Yii ?1nh ngha mt thc th ri-ng 0i@t ? nh; #ogic thm ?1nh thc t5" i'u n;y ?FcgVi #; mt #p hVc nh=n (ng* v; trong hnh thc chung nh7t ca n> #; mt #p m; thc hi@n cc giaoi@n lserlentity" Rt trong nhng vai trf chnh ca #p n;y #; ? ?>ng g>i #ogic !c thc ;ngcho php trin ,hai ,hc nhau" A.y thuc v;o y-u c&u ng Eng* chng t th c&n phBi !c nh=nmt t-n ngLi .ng v; m=t ,hu ?6i vi gi tr1 ?Fc #u tr trong mt c sb #i@u* hoc cho phpngLi .ng ?^ng nh=p vi |penl th" Ach #ogic ?> #; cE th phng php !c thc t ph&n cfn #(i ca qu trnh ?^ng nh=png Eng cho php chng ta ;ng chuyn ?i gia hi@n thc nh v=y"

    N;o protecte/components/serlentity"php

    )em qua ni ung ca lentity ta th7y vi@c thc hi@n n;y ch ?n giBn #; sD Eng t-n ?^ng nh=p / m=,hu m\ h>a cng cc gi tr1 ca 0Bn emo / emo v; quBn tr1 amin /" }> ,im tra cc gi tr1 ?6i vit-n ngLi .ng v; cc thuc tnh ca #p m=t ,hu 3t;i sBn quy ?1nh t(i cc #p cha m*Iserlentity8 v; n5u hV ,h s thi5t #=p v; trB v' mt m\ #2i thch hFp"R< hnh ho(t ?ng ca qu trnh ?^ng nh=p ?Fc m< tB nh sau:

    hiu r hn v' nhng mBnh ph. hFp vi to;n 0 qu trnh !c thc enGtoGen* chng ta h\y?i qua cc #ogic 0t ?&u vi hnh thc ?^ng nh=p" }5u chng ta ?i'u hng ?5n trang ?^ng nh=p:http://#oca#host/emo/ine!"phprjsite/#ogin* chng ta th7y mt hnh thc ?n giBn cho php ?&u

  • 8/12/2019 Yi i Framework

    27/64

    v;o ca mt t-n ngLi .ng* m=t ,hu v; t.y chVn hp ,im cho cc t;i ,hoBn Hhi nh AhLi gianAi5p theo chc n^ng m; chng t ?Fc gVi* trong ?> !c nh=n ccgi tr1 thuc tnh a tr-n cc quy tc quy ?1nh trong phng php quy ?1nh 38" %hng php n;y

    ?Fc quy ?1nh nh sau:pu0#ic $unction ru#es38

    return array3

    // username an passCor are require

    array3username* passCor* require8*

    // remem0erRe nees to 0e a 0oo#ean

    array3remem0erRe* 0oo#ean8*

    // passCor nees to 0e authenticate

    array3passCor* authenticate8*

    8

    Iu6i c.ng ca cc quy tc n;y quy ?1nh rOng thuc tnh m=t ,hu ?Fc !c nh=n 0Ong cch sDEng cc t.y chnh phng php authenticate 38* cng ?Fc ?1nh ngha trong #p Woginkorm nhsau:

    /

    Tuthenticates the passCor"

    Ahis is the authenticate va#iator as ec#are in ru#es38"/

    pu0#ic $unction authenticate3attri0ute*params8

    thisGQ_ientityjneC serlentity3thisGQusername*thisGQpassCor8

    i$3SthisGQ_ientityGQauthenticate388

    thisGQaMrror3passCor*lncorrect username or passCor"8

    Ai5p tEc thc hi@n theo cc s ?] trnh t* !c nh=n m=t ,hu trong Woginkorm cuc gVi authenticate38 phng php trong c.ng mt #p" %hng php n;y t(o ra mt th hi@n mi ca #p anh tnh !cthc ?Fc sD Eng* trong trLng hFp n;y #; / protecte/ component/ serlentity"php 0Bo v@* v; sau?> gVi !c thc ca n> authenticate 38" serlentity :: authenticate 38 nh sau:

    /

    Tuthenticates the passCor"

    Ahis is the authenticate va#iator as ec#are in ru#es38"

    /

  • 8/12/2019 Yi i Framework

    28/64

    pu0#ic $unction authenticate3attri0ute*params8

    i$3SthisGQhasMrrors388 // Ce on#y Cant to authenticate Chen no

    input errors

    ientityjneC serlentity3thisGQusername*thisGQpassCor8

    ientityGQauthenticate38

    sCitch3ientityGQerrorIoe8

    case serlentity::Mdd|d_}|}M:

    urationjthisGQremem0erRe {{zw{ : { // { ays

    Yii::app38GQuserGQ#ogin3ientity*uration8

    0rea,

    case serlentity::Mdd|d_PMd}TRM_l}NTWl:

    thisGQaMrror3username*sername is incorrect"8

    0rea,

    e$au#t: // serlentity::Mdd|d_%TPP+|d_l}NTWl

    thisGQaMrror3passCor*%assCor is incorrect"8

    0rea,

    i'u n;y ?Fc thc hi@n ? sD Eng t-n ngLi .ng v; m=t ,hu ? thc hi@n !c thc ca n>"Arong vi@c thc hi@n n;y* min #; s ,5t hFp t-n ngLi .ng / m=t ,hu #; mt trong hai 0Bn emo /emo hoc amin / amin* phng php n;y s trb #(i ?ng s th=t" Khi chng ta ?ang ?i qua mt?^ng nh=p th;nh c th thay ?iauthenticate38 trong c#ass serientity ? !c minh s t]n t(i ca mt h;ng ph. hFp vi t-nngLi .ng cung c7p v; gi tr1 m=t ,hu" K t ,hi* v;o #c n;y* c> ,h g ,hc trong c#assserlentity"php ngo(i tr authenticate metho* chng ta h\y thay th5 ho;n to;n cc ni ung cat=p tin n;y vi cc m\ sau ?4y:

    php/ serlentity represents the ata neee to ientity a user" lt contains the authentication metho that chec,s i$ the provie

  • 8/12/2019 Yi i Framework

    29/64

    ata can ienti$y the user"/c#ass serlentity e!tens Iserlentityprivate _i/ Tuthenticates a user using the ser ata moe#" return 0oo#ean Chether authentication succees"/

    pu0#ic $unction authenticate38userjser::moe#38GQ$inyTttri0utes3array3usernamejQthisGQusername88i$3userjjjnu##8thisGQerrorIoejse#$::Mdd|d_PMd}TRM_l}NTWle#sei$3userGQpassCorSjjuserGQencrypt3thisGQpassCor88

    thisGQerrorIoejse#$::Mdd|d_%TPP+|d_l}NTWle#sethisGQ_i j userGQii$3nu##jjjuserGQ#ast_#ogin_time8#astWogin j time38e#se

    #astWogin j strtotime3userGQ#ast_#ogin_time8thisGQsetPtate3#astWoginAime* #astWogin8 thisGQerrorIoejse#$::Mdd|d_}|}Mreturn SthisGQerrorIoepu0#ic $unction getl38return thisGQ_i

    Ihng ta ?\ thi5t #=p mt thuc tnh mi v;o c#ass serlentity cho l ngLi .ng" Ni@c thchi@n mc ?1nh trong cc #p cha m #; ? trB #(i t-n ngLi .ng cho l" }h chng ta ?ang sDEng mt c sb #i@u* v; c> cc phm s6 tiu nh=n (ng ngLi .ng uy nh7t* chng ta phBichc chn rOng l s6 n;y #; nhng g ?Fc thi5t #=p v; trB #(i trong su6t cc ng Eng ,hi cc lngLi .ng ?Fc y-u c&u" > #;* ,hi cc m\: Yii:: app 38 GQ userGQ i ?Fc thc thi* chng ta phB?Bm 0Bo rOng l uy nh7t t c sb #i@u ?Fc trB v'* ,h

  • 8/12/2019 Yi i Framework

    30/64

    i'u th hai !By ra b ?4y #; cc thi5t #=p ca mt thuc tnh tr-n ser lentity #; thLi gian ?^ng nh=pcu6i c.ng trb v' t c sb #i@u" Ah;nh ph&n ng Eng ngLi .ng* I+e0ser* c> ngu]n g6c thuctnh ngLi .ng l r r;ng v; cc thuc tnh t-n ?Fc ?1nh ngha trong c#ass inentity * v; sau ?> tt-n jQ cp gi tr1 trong mBng ?Fc gVi t state ientity"

    chng t t-n #; #astWoginAime #; gi tr1 ca trLng #ast_#ogin_timetrong c sb #i@u" Ong cch n;y* b 07t , ni n;o trong ng Eng* thuc tnh n;y c> th ?Fctruy c=p th mt ,im tra nhanh ch>ng cho nu## ? chng t th #u tr mt thLi ?im thch hFp ,hingLi sD Eng cc 0Bn ghi trong thLi gian ?&u ti-n"Ni nhng thay ?i n;y t(i ch2* 04y giL 0(n s c&n phBi cung c7p ?ng t-n v; m=t ,hu ,5t hFpcho mt ngLi .ng ?Fc !c ?1nh trong 0Bng t0#_user trong c sb #i@u" PD Eng emo / emohoc amin / quBn tr1 s* t7t nhi-n* c th ?^ngnh=p nh 07t , mt trong nhng ngLi sD Eng m; 0(n ?\ t(o ra trc ?> trong chng n;y"}5u 0(n #;m theo v; c> cc #i@u ngLi .ng nh chng t

  • 8/12/2019 Yi i Framework

    31/64

  • 8/12/2019 Yi i Framework

    32/64

    /pu0#ic $unction accessdu#es38return array3array3a##oC* // cho php ngLi .ng thc hi@n ine! an vieC actionsactionsjQarray3ine!*vieC8*usersjQarray38*8*

    array3a##oC* // cho php chng thc ngLi .ng vi create an upate actionsactionsjQarray3create*upate8*usersjQarray38*8*array3a##oC* // cho php amin user thc hi@n amin an e#ete actions

    actionsjQarray3amin*e#ete8*usersjQarray3amin8*8*array3eny* // A ch6i truy c=pusersjQarray38*8*8

    Retho $i#ter 38 ?\ quen thuc vi chng ta" }> #; ni m; chng ta !c ?1nh t7t cB cc $i#ter ?Fc sDEng trong #p ?i'u ,hin" Arong trLng hFp n;y* chng t mt* accessIontro#* trong ?> ?'c=p ?5n mt 0 #Vc ?Fc cung c7p 0bi ,hung Yii" #Vc n;y sD Eng phng php ,hc*accessdu#es 38* trong ?> !c ?1nh cc quy tc ?i'u ,hin h(n ch5 truy c=p"

    Arong phng php accessdu#es 38 ?\ ?' c=p trc ?4y* c> 06n quy tc quy ?1nh" R2i quy tc ?Fcth hi@n nh #; mt mBng 3array8 " Y5u t6 ?&u ti-n ca mBng c> th cho php 3a##oC8 hoc t ch6i

    3eny8" Ih ra vi@c c7p hoc t ch6i truy c=p" %h&n cfn #(i ca mBng 0ao g]m t-n jQ cp gi tr1 quy?1nh cE th cc th gi tr1 cho th7y c> hay ,h quytc n-n ?Fc p Eng" Tction: uy tc n;y quy ?1nh cE th cc phng thc h;nh ?ng* 0Ong cch sD Eng l h;nh ?ngtng ng* m; nguy-n tc phBi ph. hFp vi"sers : uy tc n;y quy ?1nh cE th ngLi sD Eng cc quy tc p Eng" Ahuc tnh t-n ngLi sDEng ng Eng hi@n t(i ?Fc sD Eng cho ph. hFp" a ,X t ?c 0i@t cng c> th ?Fc sD Eng b?4y: : 07t , ngLi .ng: v< anh ngLi .ng : !c thc ngLi sD Eng

  • 8/12/2019 Yi i Framework

    33/64

  • 8/12/2019 Yi i Framework

    34/64

  • 8/12/2019 Yi i Framework

    35/64

    chng ta v' cc item y quy'n" Iu6i c.ng* 0Bng TuthTssignment #; mt 0Bng #i-n ,5tgi m6i #i-n h@ gia mt ngLi sD Eng v; mt mEc cho php" Ic 0o co W c0Bn cho cc 0Bng nh sau:3Wu X ?4y #; #Fc ?] mc ?1nh ?\ ?Fc t(o sn ,hi thc hi@n t(o ,hung8 ;ngchng ta thc hi@n #u sn"

    T_O HW THqN PHsN (P % U%N R[A(

    Pau ,hi th-m cc 0Bng ?\ ?' c=p _ev v; _test cc c sb #i@u* chng ta c&n phBi ph 0i5n chngvi vai trf v; quy'n truy c=p" Ihng ta s #;m ?i'u n;y 0Ong cch sD Eng T%l ?Fc cung c7p 0biauthRanager" gi cho mVi th ?n giBn* chng ta s ch !c ?1nh vai trf v; ho(t ?ng c0Bn"Ihng ta s ,ha 0Z sBn phm8

    3Aha hbng quy'n truy c=p t ?c giB8"

    2/c giBdea mem0er 3Vc ?Fc anh sch th;nh vi-n8dea %roect 3Vc ?Fc cc n8dea lssue 3Vc ?Fc cc sBn phm8"

  • 8/12/2019 Yi i Framework

    36/64

    Ih sb hu c> t7t cB cc quy'n ?Fc #i@t ,-* cng vi hV tha hbng t7t cB cc quy'n t th;nh vi-nv; vai trf ?Vc" Ang t nh v=y* th;nh vi-n ?Fc tha hbng quy'n truy c=p t deaer" }hng gchng t cho 0i5t th-m cc m6i quan h@gia vai trf v; s cho php:auth%&&::appgm

  • 8/12/2019 Yi i Framework

    37/64

    Ic m< hnh dTI ch nhOm mEc ?ch thi5t #=p cc m6i quan h@ gia cc vai trf v; quy'n truy c=p"}> ,h ,5t hFp mt quy tc ,inh oanh ? ,im tra !em l ca ngLi sD Eng hi@nt(i cng gi6ng nh l ngLi sD Eng ,5t hFp vi th mt vai trf cE th* chng ta cng s #i-n ,5t mt quy tc ,inhoanh ,im tra cc m6i quan h@ trong 06i cBnh ca n" Ihec,Tccess 38 phng php cng chophp chng ta vFt qua trong mt #o(t cc th" Ihng t

  • 8/12/2019 Yi i Framework

    38/64

    Th4 h&jn !eth#d Pr#e4t AR !1&

    i'u chnh %roect::associateserAodo#e38 metho ? c> cc th s trB #(i s6 h;ng 01 Bnh hbng* trong ?>*n5u n> th;nh ca mt h;ng"

    4y giL chng ta c&n phBi thc hi@n #ogic thch hFp ? !em n5u mt #i-n ,5t t]n t(i" Ahay ?i phngthc n;y trong cc c#ass %roect Td

    pu0#ic $unction isserlndo#e3ro#e8sq# j `PMWMIA ro#e kd|R t0#_proect_user_ro#e +9MdM proect_ij:proectl T}user_ij:userl T} ro#ej:ro#e`comman j Yii::app38GQ0GQcreateIomman3sq#8commanGQ0inNa#ue3`:proectl`* thisGQi* %|::%TdTR_l}A8

  • 8/12/2019 Yi i Framework

    39/64

    commanGQ0inNa#ue3`:userl`* Yii::app38GQuserGQgetl38* %|::%TdTR_l}A8commanGQ0inNa#ue3`:ro#e`* ro#e* %|::%TdTR_PAd8return commanGQe!ecute38jjx true : $a#se

    TH~ NB DN tw D Jn gpr#e4tmIhng ta ?\ c> th t(o ?Fc ngLi .ng trong ng Eng tuy nhi-n chng ta cha c> cch

    gn cho ngLi .ng mt n cE th"N; hn th5 na vai trf ca chng trong ngEng"4y giL chng ta ti5p c=n v1 tr ca dTI chng ta c&n !4y mt h;m mi"9o;n th;nh cc mEc ?ch chng ta s thc hi@n sau ?4y: Sb d0n ph}n phJp Fu t&=n: th-m metho pu0#ic staticgetserdo#e|ptions38 t %roect moe# c#ass trB #(i anh sch hFp #@ vai trf c7u hnhsD Eng quBn #X quy'n truy c=p getdo#es38 metho" Ihng ta s sD Eng ph 0i5n mtvai trf #a chVn ropoCn $ie# trong $orm cho vi@c th-m user ca mt n 3proect8" th=! !1& !eth#d pu*l&4 associateserAo%roect3user8 tproect moe# c#ass ? #i-n ,5t mt ngLi sD Eng vi x n"Ah-m ?Lng [n tita0#e t0#_proect_user_assignment ? t(o mt s #i-n ,5t gia user v; proect" Ah-m mi metho pu0#ic isserln%roect3user8 t %roectmoe# c#ass ? quy5t ?1nh n5u ngLi .ng 0t ?&u #i-n ,5t vi proect" Ihng ta s sDEng ?i'u ?> trong mt quy tc ph. hFp t $orm ? ra quy5t ?1nh chng ta ,h trong n" A9-m mi mt $orm moe# c#ass %roectserkorm mb rng tI$ormRoe# cho input $orm moe# mi" Ah-m m< hnh c#ass $orm n;y c> thuc tnh :username*ro#e*proect "Ing th-m cc quy tc ph. hFp ? chc chn rOng cBusername v; ro#e #; ?Fc y-u c&u input $ie# v; ngLi sD Eng s ?Fc !c nh=n #;,hch h;ng hFp #@ veri$y38 c#ass"

    Neri$y38 metho s thc hi@n : Kch ho(t t(o mi ser Td c#ass ?a vi@c tm ,i5m user n6i vi input username"}5u ,ch ho(t th;nh c s ti5p tEc #i-n ,5t user vi proect sD Eng metho mi#; :associateserAo%roect3user8 " }5u ,h user ?Fc tm th7y n> s trB v'th

  • 8/12/2019 Yi i Framework

    40/64

    / deturns an array o$ avai#a0#e ro#es in Chich a user can 0e p#ace Chen 0eing ae to a proect/pu0#ic static $unction getserdo#e|ptions38

    return I9tm#::#istata3Yii::app38GQauthRanagerGQgetdo#es38* name* name8/ Ra,es an association 0etCeen a user an a the proect/pu0#ic $unction associateserAo%roect3user8sq# j `l}PMdA l}A| t0#_proect_user_assignment 3proect_i* user_i8 NTWMP 3:proectl* :userl8`comman j Yii::app38GQ0GQcreateIomman3sq#8commanGQ0inNa#ue3`:proectl`* thisGQi* %|::%TdTR_l}A8commanGQ0inNa#ue3`:userl`* userGQi* %|::%TdTR_l}A8

    return commanGQe!ecute38/ etermines Chether or not a user is a#reay part o$ a proect/pu0#ic $unction isserln%roect3user8sq# j `PMWMIA user_i kd|R t0#_proect_user_assignment +9MdM proect_ij:proectl T}

    user_ij:userl`comman j Yii::app38GQ0GQcreateIomman3sq#8commanGQ0inNa#ue3`:proectl`* thisGQi* %|::%TdTR_l}A8

    commanGQ0inNa#ue3`:userl`* userGQi* %|::%TdTR_l}A8return commanGQe!ecute38jjx true : $a#se

    Th=! !1& 7#r! !#del 4la55 Pr#e4tU5er#r!Ih ?Fc .ng gi6ng nh $orm ?^ng nh=p chng ta ?ang t(o mt $orm moe# c#ass mi nh #; mttrung t4m #u tr $orm input cc tham s6 v; t=p trung #(i cc user hFp #@" 4y #; mt c#ass ?n giBn,5 tha t Yii c#ass I$orm Roe# v; c> thuc tnh gi6ng $orm input Ihng ta c&n ng cBnh n c>th th-m user t proect :

    php

    / %roectserkorm c#ass" %roectserkorm is the ata structure $or ,eeping the $orm ata re#ate to aing an e!isting user to a proect" lt is use 0y the Tuser action o$

    %roectIontro##er"/c#ass %roectserkorm e!tens IkormRoe#/ var string username o$ the user 0eing ae to the proect/

  • 8/12/2019 Yi i Framework

    41/64

    pu0#ic username/ var string the ro#e to Chich the user Ci## 0e associate Cithin the proect/pu0#ic ro#e/ var o0ect an instance o$ the %roect Td moe# c#ass/pu0#ic proect/ ec#ares the va#iation ru#es" Ahe ru#es state that username an passCor are require* an passCor nees to 0e authenticate using the veri$y38 metho/pu0#ic $unction ru#es38return array3// username an passCor are requirearray3username* ro#e* require8*// passCor nees to 0e authenticate//array3username* veri$y8*array3username* e!ist* c#ass}amejQser8*array3username* veri$y8*8/ Tuthenticates the e!istence o$ the user in the system" l$ va#i* it Ci## a#so ma,e the association 0etCeen the user* ro#e an proect Ahis is the veri$y va#iator as ec#are in ru#es38"/pu0#ic $unction veri$y3attri0ute*params8$3SthisGQhasMrrors388 // Ce on#y Cant to authenticate Chen no other input errors are presentuser j ser::moe#38GQ$inyTttri0utes3array3usernamejQthisGQusername88$3thisGQproectGQisserln%roect3user88thisGQaMrror3username*Ahis user has a#reay 0een ae to the proect"8e#sethisGQproectGQassociateserAo%roect3user8thisGQproectGQassociateserAodo#e3thisGQro#e* userGQi8auth j Yii::app38GQauthRanager0idu#ejreturn isset3params`proect`8 params`proect`GQisserlndo#e3`"thisGQro#e"`8authGQassign3thisGQro#e*userGQi* 0idu#e8

  • 8/12/2019 Yi i Framework

    42/64

    Th=! !1& a4tn !eth#d tw pr#e4t 4#ntr#llerIhng ta c&n mt contro##er action ?i'u ,hin qu trnh tBi cc y-u c&u ? hin th1 $orm th-m user ti

    mt proect "Ah-m actionTuser38 v;o %roect Iontro##er:

    pu0#ic $unction actionTuser38$ormjneC %roectserkormproect j thisGQ#oaRoe#38

    // co##ect user input atai$3isset3_%|PA%roectserkorm88$ormGQattri0utesj_%|PA%roectserkorm$ormGQproect j proect// va#iate user input an set a sucess$u## $#assh message i$ va#ii$3$ormGQva#iate388%&&::appgm

  • 8/12/2019 Yi i Framework

    43/64

    8thisGQmenujarray3array3#a0e#jQac, Ao %roect* ur#jQarray3vieC*ijQmoe#GQproectGQi88*8QhxQT ser Ao php echo moe#GQproectGQname Q/hxQphp i$3Yii::app38GQuserGQhask#ash3success88:Qiv c#assj`successRessage`Qphp echo Yii::app38GQuserGQgetk#ash3success8 Q/ivQphp eni$ Qiv c#assj`$orm`Qphp $ormjthisGQ0egin+iget3ITctivekorm8 Qp c#assj`note`Qkie#s Cith span c#assj`require`Q/spanQ are require"/pQiv c#assj`roC`Qphp echo $ormGQ#a0e#M!3moe#*username8 Qphp thisGQCiget3ITutoIomp#ete* array3moe#jQmoe#*attri0utejQusername*atajQusernames*mu#tip#ejQ$a#se*htm#|ptionsjQarray3siejQz8*88 Qphp echo $ormGQerror3moe#*username8 Q/ivQiv c#assj`roC`Qphp echo $ormGQ#a0e#M!3moe#*ro#e8 Qphp echo $ormGQropoCnWist3moe#*ro#e* %roect::getserdo#e|ptions388 Qphp echo $ormGQerror3moe#*ro#e8 Q/ivQiv c#assj`roC 0uttons`Qphp echo I9tm#::su0mitutton3T ser8 Q/ivQphp thisGQen+iget38 Q/ivQ

    KB TRA ( % U%Ni'u cu6i c.ng chng ta c&n phBi #;m #; ,im tra th-m u quy'n cho cc chc n^ng ,hc nhau"Arc ?> trong chng n;y* chng ta ?\ phc thBo v; sau ?> thc hi@n h@ th6ng ph4n c7p y quy'dTI cho cc vai trf ,hc nhau chng ta c>" A7t cB mVi th ?Fc ?t ra ? cho php hoc t ch6itruy c=p ?5n cc chc n^ng a tr-n cc ?i'u ,hoBn ?\ ?Fc c7p cho ngLi sD Eng trong cc

    n* vi mt ngo(i #@" Ihng t :&73Yii::app38GQuserGQchec,Tccess3amin*arra93proectjQmoe#888

    thisGQmenu j arra93#a0e#jQT ser Ao %roect* ur#jQarra93auser* ijQmoe#GQi88

  • 8/12/2019 Yi i Framework

    44/64

    Wu X quy'n truy c=p amin #7y t authitem ta0#e "A7t cB cc mem0er ?Fc amin c7p php ?'u c> th v;o ?Fc"Ai5p theo ? ng^n chn vi@c user v;o 0Ong navigate ta th-m h;m ,im tra v;o actionTuser38 :

    pu0#ic $unction actionTuser38proect j thisGQ#oaRoe#38&7g%&&::appgm

  • 8/12/2019 Yi i Framework

    45/64

    IdMTAM ATWM t0#_comment3~i~ l}AMHMd }|A }WW %dlRTdY KMY TA|_l}IdMRM}A*~content~ AM)A }|A }WW*~issue_i~ l}AMHMd*~create_time~ TAMAlRM*~create_user_i~ l}AMHMd*

    ~upate_time~ TAMAlRM*~upate_user_i~ l}AMHMd8

    }hng #Li comment ?Fc !c ?1nh trong tng trang cE th ta !c ?1nh t(i trang sBn phm viissue_i v; n> ?Fc vi5t 0bi mt ngLi sD Eng cE th n-n t(o create_user_i v; !c ?1nh cc quanh@ ,h>a chnh ,h>a ngo(i"

    TWAMd ATWM ~t0#_comment~ T I|}PAdTl}A ~kK_comment_issue~ k|dMlH} KMY3~issue_i~8 dMkMdM}IMP ~t0#_issue~ 3~i~8

    TWAMd ATWM ~t0#_comment~ T I|}PAdTl}A ~kK_comment_author~ k|dMlH} KMY

    3~create_user_i~8 dMkMdM}IMP ~t0#_user~ 3~i~8)4y ng m< hnh trong Hii / Roe# Henerator v; gVi c#ass comment"GQc#ic, previeCGQgenerate"

    ,hi chng ta ?\ t(o ra moe# c#ass cho comment * chng ta s c&n th-m mt cch r r;ng m6i quanh@ t c#ass moe# lssue 3sBn phm8 cho comment" Ihng ta cng s th-m mt m6i quan h@ nh #;mt truy v7n th6ng ,- ? ;ng #7y s6 #Fng cc X ,i5n #i-n ,5tvi mt v7n ?' ?Fc ?a ra 3gi6ng nh chng ta ?\ #;m trong c#ass %roect cho lssue"8"

    i'u chnh lssue::re#ation38 3quan h@8:

    pu0#ic $unction re#ations38

    return array3requester jQ array3se#$::MW|}HP_A|* ser* requester_i8*oCner jQ array3se#$::MW|}HP_A|* ser* oCner_i8*proect jQ array3se#$::MW|}HP_A|* %roect* proect_i8*?4#!!ent5? 6 arra9g5el7::HASfAN%, ?(#!!ent?, ?&55uef&d?m,?4#!!ent(#unt? 6 arra9g5el7::STAT, ?(#!!ent?, ?&55uef&d?m,8

    }go;i ra* chng ta c&n phBi thay ?i c#ass Iomment Td ?Fc mb rng t.y chnh tArac,PtarTctivedecor c#ass 0ase * ? thu=n #Fi chng ta ?t trong 0e$oreNa#iate 38 metho " ngiBn ch c&n thay ?i ?&u ca ?1nh ngha #p nh v=y:

    php/ Ahis is the moe# c#ass $or ta0#e `t0#_comment`"

  • 8/12/2019 Yi i Framework

    46/64

  • 8/12/2019 Yi i Framework

    47/64

    thc hi@n ?Fc ?i'u n;y* ta s ?i'u chnh lssue contro##er c#ass ? !D #X cc comment cngnh thay ?i chi ti5t sBn phm hin th1 cc #Li comment hi@n c> v; t(o comment mi t$orm"}go;i ra #Li comment s ch ?Fc t(o trong v^n cBnh ca sBn phm chng ta s th-m

    mi mt metho v;o c#ass moe# lssue ? t(o mi commment"

    Th=! !xt l& 4#!!entAh-m metho trong lssue Td 3moe#8

    / Ts a comment to this issue/pu0#ic $unction aIomment3comment8commentGQissue_ijthisGQireturn commentGQsave38

    %hng php n;y ?Bm 0Bo cc thi5t #=p ph. hFp ca cc l v7n ?' 0nh #u=n trc ,hi #u cc 0nh#u=n mi" Khbi ?ng thD nghi@m mt #&n na ? ?Bm 0Bo n> ngay 04y giL ?i"

    Ihng ta mu6n t(o comment $orm ? hin th1 v; gDi #i@u trb #(i lssueIontro##er::actionNieC38metho * chng ta s c&n ?i'u chnh metho" Ihng ta cng th-m mi metho protecte ?i'u ,hin$orm %|PA request" &u ti-n* chnh #(i actionNieC38 metho :

    pu0#ic $unction actionNieC38&55ueth&5

  • 8/12/2019 Yi i Framework

    48/64

    4#!!entth&5

  • 8/12/2019 Yi i Framework

    49/64

    hQphp echo moe#GQcommentIountQx moe#GQcommentIount " comments : |ne comment Q/hQphp thisGQrener%artia#3_comments*array3commentsjQmoe#GQcomments*88 Qphp eni$ QhQWeave a Iomment/hQphp i$3Yii::app38GQuserGQhask#ash3commentPu0mitte88: Qiv c#assj`$#ashGsuccess`Qphp echo Yii::app38GQuserGQgetk#ash3commentPu0mitte8 Q/ivQphp e#se: Qphp thisGQrener%artia#3/comment/_$orm*array3moe#jQcomment*88 Qphp eni$ Q/ivQ

    Rb protecte/vieCs/comment/_$orm"php v; chnh sDa :

    iv c#assj`$orm`Qphp $ormjthisGQ0egin+iget3ITctivekorm* array3ijQcommentG$orm*ena0#eTa!Na#iationjQ$a#se*88 Qp c#assj`note`Qkie#s Cith span c#assj`require`Q/spanQ are require"/pQphp echo $ormGQerrorPummary3moe#8 Qiv c#assj`roC`Qphp echo $ormGQ#a0e#M!3moe#*content8 Qphp echo $ormGQte!tTrea3moe#*content*array3roCsjQ* co#sjQ{88 Qphp echo $ormGQerror3moe#*content8 Q/ivQiv c#assj`roC 0uttons`Qphp echo I9tm#::su0mitutton3moe#GQis}eCdecor Ireate : Pave8 Q/ivQphp thisGQen+iget38 Q/ivQ

    T-# !xt 4#!!ent5 "&det n Fc9.

    4y giL chng ta c> ,hB n^ng ? #(i X ,i5n trong sBn phm* chng ta s t=p trung v;o mEc ti-u th z"Ihng ta mu6n ? hin th1 cho ngLi .ng mt anh sch ca t7t cB cc X ,i5n g&n ?4y ?\ ?Fc?^ng trong cc trang sBn phm ,hc nhau tr-n t7t cB cc n" i'u n;y s cung c7p #i-n ,5t t6tcc ho(t ?ng truy'n th

  • 8/12/2019 Yi i Framework

    50/64

    &1& th&ju (>&detIhng t tr-ntrang chnh ca n chi ti5t ? chng ta c> th th7y ho(t ?ng ca 0nh #u=n tr-n t7t cB cc v7n ?'#i-n quan ?5n n" chng minh s ;ng ti sD Eng* chng t mt 0c !a hnv; cng c> th hin th1 mt anh sch cc n cE th X ,i5n v' trang chi ti5t n"

    A(o h;m :Am comment g&n ?4y: Arong Iomment::$indecentIomment"

    pu0#ic static $unction $indecentIomments3#imitjx{* proectljnu##8

    i$3proectl Sj nu##8return se#$::moe#38GQCith3array3issuejQarray3conitionjQproect_ij"proectl888GQ$inT##3array3orerjQt"create_time MPI*#imitjQ#imit*88e#se//get a## comments across a## proects

    return se#$::moe#38GQCith3issue8GQ$inT##3array3orerjQt"create_time MPI*#imitjQ#imit*88

    Retho tr- n c> z tham s6 #imit ? h(n ch5 s6 #Fng* proectl !c ?1nh i n m; cc comment nOmtrong ?>" Aham s6 th z s gip cho Ciget sD Eng hin th1 t7t cB comment trong x n"N v=y* n5u i?&u v;o n ?\ ?Fc ch ?1nh* n> h(n ch5 cc ,5t quB trB v' ch nhng X ,i5n #i-n ,5t vi n*n5u ,h

  • 8/12/2019 Yi i Framework

    51/64

    proects j %roect::moe#38GQCith3issues8GQ$inT##38

    Arong Iomment::$indecentIomments38 ta c> :return 5el7::model38GQCith3issue8GQ$inT##3arra93orerjQt"create_time MPI*#imitjQ#imit*88chng ta ch ?1nh t"create_time cho 0i5t ta mu6n sD Eng ct ca 0Bng chnh" }5u chng ta mu6n thay

    v ? cc ct create_time issue * chng t&det4y giL chng ta ?\ sn s;ng ? t(o ra cc Ciget mi ca chng t

  • 8/12/2019 Yi i Framework

    52/64

    decentIomments is a Yii Ciget use to isp#ay a #ist o$ recent comments/c#ass decentIomments e!tens I+igetprivate _commentspu0#ic isp#ayWimit j pu0#ic proectl j nu##pu0#ic $unction init38

    thisGQ_comments j Iomment::moe#38 GQ$indecentIomments3thisGQisp#ayWimit* thisGQproectl8pu0#ic $unction getdecentIomments38return thisGQ_commentspu0#ic $unction run38// this metho is ca##e 0y IIontro##er::en+iget38thisGQrener3recentIomments8

    I #i-n quan ?5n vieC$i#e * m; chng ta v[n cha t(o ra" cc t=p tin !em* theo quy c* ?Fc?t trong vieC / irect#y trong c.ng mt th mEc Ciget c tr* v; c> t-n tng t nh Ciget* nhng0t ?&u vi mt # th ch thLng" A(o t=p tin trong protec/component / vieCs /recentIomments"php"

    u#Qphp $oreach3thisGQgetdecentIomments38 as comment8: Qiv c#assj`author`Qphp echo commentGQauthorGQusername Q ae a comment"/ivQiv c#assj`issue`Qphp echo I9tm#::#in,3I9tm#::encoe3commentGQissueGQname8* array3issue/vieC* ijQcommentG

    QissueGQi88 Q/ivQphp en$oreach Q/u#Q

    Rb protecte/vieCs/proect/ine!"php" Ah-m v;o cu6i trangphp thisGQCiget3decentIomments8 Q

    &1& th&ju (p#rtlet:I%ort#et #; mt ph&n ca ii* mb rng #p th vi@n chnh thc ?>ng g>i ?i ,m vi Yii" }> cung c7pmt #p c sb t6t ?p cho t7t cB cc v=t Eng theo phong cch port#et" }> s cho php chng ta #;mcho mt ti-u ?' t6t ?p cng nh ph. hFp 9ARW ?nh 7u* v v=y t7t cB cc port#et tr-n cc ng Engc> th ;ng theo ,iu mt cch tng t" Rt ,hi chng ta c> mt ti@n ch #;m cho ni ung 3nhphE t.ng decentIomments ca chng t

  • 8/12/2019 Yi i Framework

    53/64

  • 8/12/2019 Yi i Framework

    54/64

  • 8/12/2019 Yi i Framework

    55/64

    ?t chng v;o ph&n th

  • 8/12/2019 Yi i Framework

    56/64

    PD Eng cc tnh n^ng qu6c t5 v; ni ?1a ho ca Yii 1chmt ph&n ca ng Eng ca chng t

  • 8/12/2019 Yi i Framework

    57/64

    I%hpRessagePource: 4y #; ngu]n th t-n message ? #u tr cc tin nhn ?Fc sD Eng trong mt ng Eng sD Eng"Aheo mc ?1nh* cc #o(i ngu]n tin nhn n;y #; I%hpRessagePource v; con ?Lng c sb ? #u trcc t=p tin 0Bn 1ch %9% #; :protecte/messages"Pay ?4y #; mt v E s ?i mt chng ?Lng ;i ? gip mang #(i t7t cB nhng ?i'u n;y vi nhau"9\y 1ch nh\n trLng 0iu m[u ?^ng nh=p ca chng t 0Bn 1chm[u ca chng ta*ta ch c&n thi5t #=p n> trong PiteIontro##er::actionWogin38 metho*o ?> n> ch pEng ,hi rener cho #ogin38"Rb t=p tin v; thi5t #=p ng

  • 8/12/2019 Yi i Framework

    58/64

    pu0#ic $unction actionWogin38Yii::app38GQ#anguage j vi

    4y giL* ?i'u cu6i c.ng chng ta c&n #;m #; thc hi@n gVi ti Yii:: t 38 ? nhng trLng 3$ie#8 #a0e#?Fc gDi th

  • 8/12/2019 Yi i Framework

    59/64

    p c#assj`hint`QttQnimaJnima/ttQ ro ttQomeJome/ttQ htiC nigo# yam uoy :tnih/pQ/ivQiv c#assj`roC remem0erRe`Qphp echo $ormGQchec,o!3moe#*remem0erRe8 Qphp echo $ormGQ#a0e#3moe#*remem0erRe8 Qphp echo $ormGQerror3moe#*remem0erRe8 Q/ivQiv c#assj`roC 0uttons`Qphp echo I9tm#::su0mitutton3}igo#8 Q/ivQphp thisGQen+iget38 Q/ivQSGG $orm GGQ

    Th=! t&n nhn ! rxn tw hj th]n

    T-# *\n data*a5e(n t(o mt 0Bng mi nh sau ch a th 0Bng ata0ase 0(n th-m v;o sq# ? t(o 0Bng v; thc hi@n 0bi * the Hii coe generator" Ihng ta 0t?&u sD Eng #del enerat#r option ? t(o cc c#ass moe# v; sau ?> (rud enerat#r t(o c 0Bn sca$$o#ingnhanh ch>ng vi moe#" Ho ahea an navigate to the Hii too# $orm $or creating a neC moe#" Ahis time* as Ce areoing this Cithin the conte!t o$ a mou#e* Ce nee to e!p#icit#y speci$y the moe# path" ki## out the $orm Cith the va#ueepicte as shoCn in the $o##oCing screenshot 3though* o$ course* your (#de Te!plate path va#ue shou# 0e speci$ito your #oca# setup8:

  • 8/12/2019 Yi i Framework

    60/64

  • 8/12/2019 Yi i Framework

    61/64

    TH=! l&n$ 8# h! !1&Rb $i#e cha main menu chnh t* /protecte/mou#es/amin/vieCs/#ayouts/main"php* v; th-m ?o(narray sau v;o menu Ciget:array3#a0e#jQPystem Ressages* ur#jQarray3/amin/sysRessage/ine!88*

    x" copy z 0Bng #ayout t ngo;i main app#ication ti mou#e: > #;: copy/protecte/vieCs/#ayouts/co#umnz"php ti /protecte/mou#es/amin/vieCs/#ayouts/co#umnz"php"z" )>a /#ayouts/main #; input t 0eginIontent38 metho gVi trc fng 0(n va copie #;co#umnz"php $i#e"" i'u chnh PysRessage moe# c#ass ?Fc e!ten 3,5 tha8 Arac,starTctivedecor 3}5u n> gVi#(i* th-m coe ?Fc t ?ng upate ngo;i create_time/user v; upate_time/user properties" i'uchnh PysRessageIontro##er contro##er c#ass ? sD Eng co#umn co#umnz"php #ayout $i#e t ,h th !>a nhng $ie# ,ha ru#es #i-n quan ?5n chng3associate ru#es8 $rom the moe# c#ass" )>a z ru#es sau t PysRessage::ru#es38 metho:array3create_user* upate_user* numerica#* integer|n#yjQtrue8* an array3create_time*upate_time* sa$e8"

    |ne #ast change Ce shou# ma,e is to upate our simp#e access ru#es to re$#ect the requirement that on#y users in thamin ro#e can access our action methos" Ahis is most#y $or i##ustrative purposes as Ce a#reay too, care o$ theaccess using our dTI moe# approach in theTminRou#e::0e$oreIontro#erTction metho itse#$" +e cou# actua##y

    ust remove the accessdu#es entire#y" 9oCever* #ets ust upate them to re$#ect the requirement so you can see hoC

    that Cou# Cor, using the access ru#e approach" ln the PysRessageIontro##er::accessdu#es38 metho* change the entirecontents to the $o##oCing:

    pu0#ic $unction accessdu#es38return array3array3a##oC* // a##oC on#y users in the amin ro#e access to our actionsactionsjQarray3ine!*vieC* create* upate* amin* e#ete8*ro#esjQarray3amin8*8*array3eny* // eny a## users

  • 8/12/2019 Yi i Framework

    62/64

  • 8/12/2019 Yi i Framework

    63/64

    Sele4t&n the !#5t re4entl9 updated !e55ae+e## restrict the isp#ay to ust one message* an Ce## choose the most recent#y upate message* 0ase on theupate_time co#umn in the ta0#e" Ts Ce Cant to a this to the main proects #isting page* Ce nee to a#ter the%roectIontro##er::actionlne!38 metho" T#ter that metho 0y aing the $o##oCing high#ighte coe:

    pu0#ic $unction actionlne!38

    ata%rovierjneC ITctiveata%rovier3%roect8Yii::app38GQc#ientPcriptGQregisterWin,Aag3a#ternate*app#ication/rss!m#*thisGQcreater#3comment/$ee88

    //et the late5t 595te! !e55ae t# d&5pla9 *a5ed #n the updateft&!e 4#lu!n595e55ae S95e55ae::!#delgm

  • 8/12/2019 Yi i Framework

    64/64

    3 %ht trin ng Eng Yii x"x 8http://""".5e#drupal.8n