? ???? ??? ?????? ??? ?????? YII? ?? ??? ?? ??? ?????. ???? N 1 ?? ? ???? ? ??? ?? ??? ??? ???, ??? ?? ? ?? ??? ?? ??? ????? ?? ??? ?????. ?
??? ?????? ????? YII? ?? ?? ??? ? : ??? ? ???
? ???? ??? ?????? ??? ?? YII? ?? ??? ?? ?? ? ? ???? ?? ? ?? ??? ????. ??? ??? ??, ??? ??? ??? ????? ?? ? ?? ??? ????? ?????.
YII? ?? ??? ??? ?????? ??? ??? ?? ? ? ?????
YII? ?? ??? ?????? ??, ??? ??? ??? ?????? ???? ?? ?? ?????? ?????. RAW SQL? ???? ?? ??? ???? ??? ???? ?????. ?? ???, ?? ?? ? ?????? ???? ??????.
?? ??, ?? ? ??? ??? ??? ???????. ??? ???? ?? ????? ??? users
? orders
???? ??? ???????. ?? ?? ?? ??? ?? ??? ???? ????????.
<code class="php">use yii\db\Query; $query = (new Query()) ->select(['user.id', 'user.username', 'order.order_date']) ->from('user') ->innerJoin('order', 'user.id = order.user_id') ->where(['>=', 'order.order_date', date('Ym-d', strtotime('-7 days'))]) ->orderBy(['order.order_date' => SORT_DESC]) ->all(); print_r($query);</code>
? ?? ? ??? ? ?? ?? ??? ?????.
-
select()
: ?? ? ?? ?????. -
from()
: ?? ???? ?????. -
innerJoin()
:user_id
??? ????order
???? ?? ??? ?????. ?? ?? ?? (?? ??, ??? ??)? ????? ??? ? ????. -
where()
: ?? ??? ?? ??? ??????. ??? ?? ??? (>, =, andWhere() ?orWhere()
???? ??? ?? ? ? ????. -
orderBy()
: ?? ???? ??? ?????? ?????. -
all()
: ??? ???? ???? ?? ?? ?? ??? ?????.
? ???? ??? ?? SQL? ???? ??? ?? ?? ?? ?? ?????. Query Builder? ?????? ? ??? ???? ?? ?????? ????? ??? ?? ? ? ??????.
??? ??? YII? ?? ??? ??? ? ??? ? ???? ??? ??????
? ?? ??? ??? ??? ?? ? ? YII? ?? ??? ??? ?? ? ? ????.
- n 1 ?? : ??? ?? ?? (? : ???) ??? ??? ?? ??? ??? ???? ? ??? ?? ?? ?? (? : ??)? ?? ? ? ?????. ?? ?? ?? ?????? ??? ???? ??? ? ??? ????.
with()
???? ??????? ???? ?? ???? ?? ??? ?????. ? :$users = User::find()->with('orders')->all();
- ???? ? ?? : ???? ?? ?? ?? ??? ????? ?? ?? ??? ???? ??? ??? ? ????. ??? ??? ???? ???? ??? ?? ??? ?? ?? (??, ??, ???)? ??????. ???? ??? ?????.
- ????? ??? ???? ????? :
where()
?? ?????. ? ???? ?? ??? ?? ??? ??? ? ?? ???? ?? ??andWhere()
?orWhere()
? ??????. - ??? ?? : ??? ?????? ???? ??? ??? ??? ??? ? ? ????. ?? ?? ? ?? ????? ?? ??? ????????.
- ?? ??? ?? : ?? ???? ?? ?? ?? ??? (??? ?? ??) ??????? SQL ?? ???? ?? ?? ????? ?? ?. ?? ???? ?? ?? ?? ??? ? ??? ??????. YII? ?? ??? ?? ???? ???? ?????.
-
explain()
?????? : ???????explain
??EXPLAIN PLAN
??? ???? ?? ?? ??? ??????. ?? ?? ??? ?? ?? ???? ? ?? ??? ?? ?? ?? ??? ???? ? ??????.
??? ?? YII? ?? ??? ?? ? ??? ?????? ??? ??? ??? ? ? ?????
??? ??? ????????? ?? ??? ?????.
- ??? :
where
,join
?orderBy
? ?? ? ??? ??? ???? ????. ??? ??? ??? ?????? ?? ?? ??? ??????. - ?????? (
with()
) : ?????? ???? ?? ???? ?? ???? ?? ?? N 1 ??? ?????. - ?? ?? : ?? ???? ??? ?? ?? ??? ???? ????????? ????. YII? ?? ?? ????? ????? ?????.
- ?? ?? : ?? ? ??? ??? ?? ? ? ??? ??? ? ?????
limit()
?offset()
?????. Pagination? ? ?? ??? ???? ?? ?????. - ???? ? : YII? ???? ? ??? ???? ?? ??? ?? ?? ??? ??????.
- ?????? ?? : ?????? ??? ???? ???? ?? ??? ??? (CPU, ???, ??? I/O)? ??? ??????.
YII? ?? ??? ???? ??? ?????? ???? ?? ? ?? ??? ????? ?? ? ? ???????
?, YII? ?? ??? ?? ? ?? ??? ????? ?????. ??? ?? ??? ?? ?????. ?? ??? ?? exists()
, in()
? notIn()
???? ???? where()
??? ?? ??? ?? ? ? ????. Query
??? ?????? ??? ?? ??? ???? from()
???? ?? ??? ???? ?? ????.
?? ???? ? :
<code class="php">$subQuery = (new Query()) ->select('id') ->from('order') ->where(['>=', 'order_date', date('Ym-d', strtotime('-7 days'))]); $query = (new Query()) ->select(['user.id', 'user.username']) ->from('user') ->where(['in', 'id', $subQuery]); $result = $query->all();</code>
??? ?? ?? ??? ? ???? ???? ?? ??? ???? ?? ???? ?????. in()
???? ?? ??? ??? ?? ??? where
??? ????? ?????. SQL ?? ???? ???? ?? ?? ??? ?? ????????. YII? ?? ??? ???? ???? ??? ? ?? ???? ???? ?????.
? ??? YII? ?? ??? ??? ?????? ??? ??? ?? ? ? ?????? ?? ?????. ??? ??? 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 '? ?? ??? ???? ??????.

YII ??? ??? ??????? ???? ???? ?? ActiveRecord ??? ?? ?????. 1. ? ???? ????? ??? ?????, ???????? ???? ?? ???????. 2. ???? ??????? ???? ?? ?? ???? ???????. 3. ?? ??? load () ???? ???? ?? ?? ??? ?? ()? ????????. 4. ?? ???? ??? ?? ???? ???? ?? ????? ???????. ?? ???? ??? ?????. ??? ??????? Load ()? ???? ???, Validate () Verification? ???? Save () ???? ?????. ???? ? ?, ?? ???? ?? ?? ?? ?????. ??? ??? ???? ?? ??? ???????. ?? ??? ??? ?? BeginTran? ???????

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

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,

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

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