ThinkPHP6?? ????? ??? ???? ??
Jun 21, 2023 am 09:40 AM? ??????? ???? ???? ?? ?? ???? ???? ???? ?? ? ?? ?? ??? ?????. ????? ??? ??? ?? ? ?? ??? ???? ?? ?? ??? ??? ?? ??? ?? ??? ???? ?? ?? ???? ??? ?????. ? ????? ThinkPHP6? ????? ??? ???? ?? ??? ????? ??? ???????.
????? ???? ??????
????? ??? ??? ??? ??? ???? ??? ???? ??? ???? ???? ??? ?????. ??? ??? ??? ?? ?????? ???? ?? ?? ?? ???? ??????. ????? ??? ?? ??? ??? ???? ?? ???? ????? ????. ???? ??? ??? ??? ??? ???? ?? ?? ?? ?? ??? ?? ?? ???? ?? ? ????.
ThinkPHP6?? ????? ?? ??
ThinkPHP6??? ????? ??? ???? ??? ??? ??? ???? ??? ??? ? ????. ??? ??? ??? ?? ?? ??? ???? ?? ??? ??? ?? Repository ???? ??? ? ????. ? ?? ??? ???? ?? ??? ?? ??? ?? ??? ?? ?? ???? ??? ? ??? ? ????.
????? ThinkPHP6?? Repository ??? ???? ??? ?????.
1. Repository ??? ???
??? ?? ?? ??? ???? ???? Repository ???? ????. ???? ??? ??? ??? ??? ? ??? ?? ????? ??? ? ????. ????? ???? ????? ?? ??? ?? ??? ? ??? ?? ?????? ?????.
namespace appepository; use appmodelUser; use thinkCollection; interface UserRepositoryInterface { public function findById(int $id): ?User; public function findAll(): Collection; } class UserRepository implements UserRepositoryInterface { /** * @var User */ private User $userModel; public function __construct(User $userModel) { $this->userModel = $userModel; } public function findById(int $id): ?User { return $this->userModel->find($id); } public function findAll(): Collection { return $this->userModel->select(); } }
?? ???? UserRepositoryInterface ?????? ???? UserRepository ???? ??????. ???? __construct ???? User ?? ????? ???? ?? ??? ?? ????? ????. ?? ?? ?? ???? ?? ???? ?? ? ???? ?????? ? ?? ??? findById ? findAll? ??????.
2. Repository ??? ??
Repository ???? ???? Controller ???? ?? ??? ? ????. Controller ???? ???? Repository ??? ????? ???? ???.
namespace appcontroller; use appepositoryUserRepository; class UserController extends Base { /** * @var UserRepository */ private UserRepository $userRepository; public function __construct(UserRepository $userRepository) { $this->userRepository = $userRepository; } public function index() { $users = $this->userRepository->findAll(); $this->view->assign('users', $users); return $this->view->fetch(); } public function show(int $id) { $user = $this->userRepository->findById($id); $this->view->assign('user', $user); return $this->view->fetch(); } }
? ???? UserRepository ????? ??? ?? ?? ????? ???? Controller ??? ??? ? ?? ????? ?? ??? ??????. ? ?? ??? ???? ???? ??? ??? ??? ??? ? ????? ???? ??? ??? ? ???? ???? ?? ?? ? ????.
??
?? ???? ThinkPHP6?? Repository ??? ???? ???? ??? ??? ?? ??? ???? ??? ??????. ??? ??? ??? ???? ?? Repository ???? ?? ?? Controller ???? ? ???? ???? ?? ??? ??????. ? ?? ??? ??? ???? ?? ???? ????? ??? ??? ?? ???? ?? ??? ? ?? ????. ? ??? ??? ??? ????!
? ??? ThinkPHP6?? ????? ??? ???? ??? ?? ?????. ??? ??? 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)

WeChat ???? ??? ??? ?????? ?? ????? ??? ??? ???? ??? ???? ?? ?? ??? ???? ???? ?? ??? ???? ?? ??? ?????. WeChat? ???? ?? ?? ?? ?? ??? ??? ? ???? ?? ?? ??? WeChat ??? ??? ????. ??? ??? ?? ??, ??, ???? ????? ????, ?? ?? ?? ????, ??? ?? ??? ?? ? ????. ??? ? ??? ??? ?? ??? ??? ???? ??? ??? ????? ???? ???. ?? ????? ???? ?? ?????? ?? ?????.

iOS ????? ???? ?? ?? ???? ?? ?? ?? ??? ? ?????. ??? ?? ?? ?? ???? ??? ??? ??? ?? ???? ??? ??? ???? ???? ? ???? ?? ??? ??? ? ????. ???? ??? ??? ?? ??? ????? ?? ?? ? ?? ?? ?????, ?? ?? ??? ??? ???? ?? ? ????. ???? ???? ?? ??? ?????. ?? ?? ??? ???? iPhone?? ???? ??? ?????. iPhone?? ?? ??? ?? ??? ???? ?? ??? "??" ?? ?? ??? ?? ???? ????? iOS? ?? ?? ?????. ??? ???? ? ??? ???.

ThinkPHP ????? ????? ??? ?????: Composer? ????, ???? ????? ???? php bin/console? ????, ?? ???? ??? http://localhost:8000? ?????.

ThinkPHP?? ??? PHP ????? ??? ?? ??? ????. ??? ???? 3.2, 5.0, 5.1, 6.0? ????, ??? ??? ??? ???? ??? ??? ???? ? ?????. ?? ?? ??? ThinkPHP 6.0.16???. ??? ??? ? PHP ??, ?? ?? ?? ? ???? ??? ??????. ??? ??? ??? ???? ?? ?? ??? ???? ?? ????.

?? ?? ???? ??? ?? ??? ?? ???? ??? ? ? ????. ???? ? ? ??? ?? ?? ??? ?? ?? ?? ??? ???, ??? ?? ??? ???. ?? ??? ??? ?? ??? ??? ? ????. ?? 1 – ?? ?? ??? ????? ?? ??? ??????. 1?? – ??? ??? ?????? ?? ??? ??????. 2?? – ???? ????? "?? ??"? ??????. ?? ??? ????? ?? ?? ??? ??????. ?? ?? ??? ???? ????? ????. ?? 2 - ?? ?? ?? ?? ?? ?? ??? ??? ?? ?? ?? ???? ???. 1?? – iPhone ?? ?? ???. 2?? – ???? ?? ?? ??? ???.

ThinkPHP Framework? ???? ???? ??: ThinkPHP Framework? ?? ????? ?????? ??? ???. ThinkPHP ?? ????? ???? ?? ???(?? ??)? ????. ?????? ?? ????? ?????. ? ??? ?????. ThinkPHP ??????? ??????. ThinkPHP ?????? URL? ???? ?????.

Laravel? ThinkPHP ?????? ?? ??: ThinkPHP? ????? ??? ? ??? ??? ?? Laravel?? ??? ????. Laravel? ? ????? ??? ??????? ?? ThinkPHP? ? ??? ? ????.

ThinkPHP ?? ??: PHP, Composer ? MySQL ??? ?????. Composer? ???? ????? ????. ThinkPHP ?????? ???? ?????. ?????? ??? ?????. ?????? ??? ?????. ??????? ???? http://localhost:8000? ?????.
