Escolar Documentos
Profissional Documentos
Cultura Documentos
Linguagem Dinamica Linguagem com foco em desenvolvimento Web - Velocidade e robustez - Estruturado eorientado a objetos - ortabilidade - !i"agem dinamica - Sinta#e similar ao $%$&&e erl - '"en-source
' ( tem muitas bibliotecas) E#* S'+ , -ML, D'M, Stream, D' etc))) !em uma comunidade gigantesca) E#) Listas, gru"os, foruns, em"resas) +tualiza./es constantes) Documenta.0o)
Estatisticas
Linguagem Sites Porcentagem
file:///C:/Users/Internet/Desktop/joomla.jpeg
YII Framework
' nome 6ii re"resenta as "alavras f7cil 8eas9:, e;ciente 8ef;cient: e e#tens<vel 8e#tensible: 6ii 5 um frame3or2 de alta "erformance em ( 4ue utiliza com"onentes "ara o desenvolvimento de grandes a"lica./es Web) =eutiliza.0o de c>digos) +celera.0o signi;cativa do "rocesso de desenvolvimento) ' 6ii 5 um frame3or2 de "rograma.0o Web gen5rico) $aching "ara o desenvolvimento de a"lica./es com alto tr7fego de dados) $omo a maioria dos frame3or2s ( , ' 6ii 5 um frame3or2 MV$) E;ciente, rico em recursos e bem documentado) ' 6ii 5 n0o 5 nem um sub"roduto de algum "rojeto, nem um conglomerado de trabalho de terceiros)
htt"*%%nomedoservidor%caminho%do%9ii%re4uirements%inde#)"h"
YII Framework:
!"
Modelo-Vis0o-$ontrole ' 6ii im"lementa o "adr0o de desenvolvimento modelo-vis0o-controle 8MV$: 4ue 5 am"lamente adotado na "rograma.0o Web) ' MV$ visa se"arar a l>gica de neg>cio da interface com o usu7rio, assim os "rogramadores "odem mudar facilmente cada "arte, sem afetar as outras) No "adr0o MV$, o modelo re"resenta as informa./es 8os dados: e as regras de neg>cio, a vis0o cont5m elemento de interface com o usu7rio, como te#tos, formul7rios, e o controle gerencia a comunica.0o entre o modelo e a vis0o) +l5m MV$, o 6ii tamb5m introduz um controle de frente, chamado a"lica.0o 8a""lication:, 4ue re"resenta o conte#to de e#ecu.0o dos "rocessos re4uisitados) + a"lica.0o recebe a solicita.0o do usu7rio e a envia "ara um controlador ade4uado "ara ser "rocessada)
', !
<?php // change the following paths if necessar& H&ii(dirname(++,-./++ %'/%%/%%/&ii-8%8%=%r9EII/framewor*/&ii%php'! Hconfig(dirname(++,-./++ %'/protected/config/main%php'! // remoAe the following lines when in production mode defined('Y--+0/J>6' or define('Y--+0/J>6',true ! // specif& how man& leAels of call stac* should $e shown in each log message defined('Y--+"1A'/+./K/.' or define('Y--+"1A'/+./K/.',: ! reBuire+once(H&ii ! Yii::create#e$Application(Hconfig -)run( !
I) r5-inicia a a"lica.0o com o m5todo $+""lication**"reinit8:K J) $onfigura as o auto-carregamento de classes 8autoloader: e o tratamento de errosK L) =egistra os "rinci"ais com"onentes da a"lica.0oK M) $arrega as configura./es da a"lica.0oK N) Hnicia a a"lica.0o com o $+""lication**init8:* I) =egistra os com"ortamentos 8behaviors: da a"lica.0oK J) $arrega os com"onentes est7ticos da a"lica.0oK O) Dis"ara o evento onPegin=e4uest 8no in<cio da re4uisi.0o:K Q) rocessa a re4uisi.0o do usu7rio* I) =esolve a re4uisi.0o do usu7rioK J) $ria um controleK L) E#ecuta o controleK R) Dis"ara o evento onEnd=e4uest 8ao fim da re4uisi.0o:K
YII Framework:
<?php
odel
/44 4 "his is the model class for ta$le PentidadeP% 4 4 "he followings are the aAaila$le columns in ta$le 'entidade': 4 @property integer Hid 4 @property string Hnome 4 @property string Hdescricao 4/ class /ntidade eLtends 'ActiAe1ecord M /44 4 1eturns the static model of the specified A1 class% 4 @return /ntidade the static model class 4/ pu$lic static function model(HclassOame(++'.A22++ M return parent::model(HclassOame ! N /44 4 @return string the associated data$ase ta$le name 4/ pu$lic function ta$leOame( M return 'entidade'! N
YII Framework:
odel
/44 4 @return arra& Aalidation rules for model attri$utes% 4/ pu$lic function rules( M // OO"/: &ou should onl& define rules for those attri$utes that // will receiAe user inputs% return arra&( arra&('nome, descricao', 'reBuired' , arra&('nome, descricao', 'length', 'maL'()9<< , // "he following rule is used $& search( % // Please remoAe those attri$utes that should not $e searched% arra&('id, nome, descricao', 'safe', 'on'()'search' , ! N /44 4 @return arra& relational rules% 4/ pu$lic function relations( M // OO"/: &ou ma& need to ad5ust the relation name and the related // class name for the relations automaticall& generated $elow% return arra&( ! N
YII Framework:
odel
/44 4 @return arra& customiQed attri$ute la$els (name()la$el 4/ pu$lic function attri$ute.a$els( M return arra&( 'id' () '-0', 'nome' () 'Oome', 'descricao' () '0escricao', ! N /44 4 1etrieAes a list of models $ased on the current search/filter conditions% 4 @return 'ActiAe0ataProAider the data proAider that can return the models $ased on the search/filter conditions% 4/ pu$lic function search( M // #arning: Please modif& the following code to remoAe attri$utes that // should not $e searched% Hcriteria(new '0$'riteria! Hcriteria-)compare('id',Hthis-)id ! Hcriteria-)compare('nome',Hthis-)nome,true ! Hcriteria-)compare('descricao',Hthis-)descricao,true ! return new 'ActiAe0ataProAider(get+class(Hthis , arra&( 'criteria'()Hcriteria, ! N N
ain
<R0O'"YP/ html P>J.-' P-//#:'//0"0 3F"7. 8%D 2trict///OP Phttp://www%w:%org/"1/Lhtml8/0"0/Lhtml8-strict%dtdP) <html Lmlns("http://www.w3.org/1999/xhtml" Lml:lang("en" lang("en") <head) <meta http-eBuiA("Content-Type" content("text/html; charset=utf- " /) <meta name("language" content("en" /) <R-- $lueprint '22 framewor* --) <lin* rel("stylesheet" t&pe("text/css" href(P<?php echo Yii::app( -)reBuest)$ase>rl! ?)/css/screen.cssP media("screen! pro"ect#on" /) <lin* rel("stylesheet" t&pe("text/css" href(P<?php echo Yii::app( -)reBuest)$ase>rl! ?)/css/pr#nt.cssP media("pr#nt" /) <R--Sif lt -/ ET) <lin* rel(Pst&lesheetP t&pe(PteLt/cssP href(P<?php echo Yii::app( -)reBuest-)$ase>rl! ? )/css/ie%cssP media(Pscreen, pro5ectionP /) <RSendifT--) <lin* rel("stylesheet" t&pe("text/css" href(P<?php echo Yii::app( -)reBuest)$ase>rl! ?)/css/ma#n.cssP /) <lin* rel("stylesheet" t&pe("text/css" href(P<?php echo Yii::app( -)reBuest)$ase>rl! ?)/css/form.cssP /) <script language(""a$ascr#pt" src(P<?php echo Yii::app( -)reBuest-)$ase>rl! ? )/"s/"s/"%uery."sP )</script) <script language(""a$ascr#pt" src(P<?php echo Yii::app( -)reBuest-)$ase>rl! ? )/"s/start."sP )</script) <title)<?php echo 'Ftml::encode(Hthis-)page"itle ! ?)</title) </head)
ain
<$od&) <diA class("conta#ner" id("page") <diA id("hea&er") <diA id("logo")<?php echo 'Ftml::encode(Hthis-)page"itle ! ?)</diA) </diA)<R-- header --) <?php if(RYii::app( -)user-)is6uest M ?) <diA id("alert'hea&er" class("alert'hea&er") </diA) <?php N ?) <?php Hthis-)widget('Qii%widgets%'Jreadcrum$s', arra&( 'lin*s' () Hthis-)$readcrum$s, ! ?)<R-- $readcrum$s --) <?php echo Hcontent! ?) <diA id("footer") 'op&right Ucop&! 1ede Pampa - <?php echo date('Y' ! ?)% </diA)<R-- footer --) </diA)<R-- page --) </$od&) </html)
<?php Hthis-)$readcrum$s(arra&( '/Lemplo'()arra&('/eLemplo' , 'Action8', !?) <h8)<?php echo Hthis-)id % '/' % Hthis-)action-)id! ? )</h8) <p) You ma& change the content of this page $& modif&ing the file <tt)<?php echo ++,-./++! ?)</tt)% </p)
anage
/44 4 0eletes a particular model% 4 -f deletion is successful, the $rowser will $e redirected to the 'indeL' page% 4 @param integer Hid the -0 of the model to $e deleted 4/ pu$lic function action0elete(Hid M if(Yii::app( -)reBuest-)isPost1eBuest M // we onl& allow deletion Aia PO2" reBuest Hthis-)load7odel(Hid -)delete( ! // if AVA3 reBuest (triggered $& deletion Aia admin grid Aiew , we should not redirect the $rowser if(Risset(H+6/"S'a5aL'T Hthis-)redirect(isset(H+PO2"S'return>rl'T ? H+PO2"S'return>rl'T : arra&('admin' N else throw new 'Fttp/Lception(;DD,'-nAalid reBuest% Please do not repeat this reBuest again%' ! N
! ?)
! ?)
<diA class("row (uttons") <?php echo 'Ftml::su$mitJutton(Hmodel-)isOew1ecord ? ''reate' : '2aAe' ! ?) </diA) <?php Hthis-)end#idget( ! ?) </diA)<R-- form --)