A standalone editor playground for PHPantom's Yii 3 support. It is the
application yiisoft/app generates, with the tooling trimmed off and a small
blog added: a route group, a controller, views rendered through an alias, and
a DI definition, each declared the way a real Yii 3 project declares them.
- Open
config/common/routes.php. Theblog/group's routes name their handlers as[PostController::class, 'index']and[PostController::class, 'view']. Go to the definition of'view', find its references, or rename it, and the method insrc/Web/Blog/PostController.phpfollows. - Open
resources/views/blog/index.php. Go to the definition of'blog/post'in$urlGenerator->generate(), which lands on the route that declares it under its group'sblog/prefix. Complete route names there, and the'slug'key, which is the placeholder the route's path declares. InPostController::view(),#[RouteArgument('slug')]goes to that{slug}and completes from it, and a name the path does not declare is reported. - Open
config/common/di/blog.php. Go to the definition ofInMemoryPostRepository, the class the container builds forPostRepositoryInterface. Its constructor's$posts, itssetLogger()method, and its$pageSizeproperty are the names the definition's keys spell. - In
PostController::view(), hover$postor complete after$post->. The repository's interface declares whatfindBySlug()returns. - Open
resources/views/blog/index.php. Hover$postinside the loop, or complete after$post->. The template declares the variables the controller passes it with@var. - In
PostController::index(), go to the definition of'index'. The controller'swithViewPath('@views/blog')and the@viewsalias inconfig/common/aliases.phpmake itresources/views/blog/index.php. Clear the name to complete it from the views there, and misspell it to see it reported.src/Web/HomePage/Action.phpnames its template as__DIR__ . '/template'instead, andindex.phprenders'_card'from beside itself. Openresources/views/blog/_card.phpfor the lens listing the calls that render it.
- Run
composer installin this directory to install Yii. - Open this directory as a project or workspace folder in your editor.
php assertions.php builds the configuration and DI container the way Yii's
web runner does and checks every name the demo declares. To see the
application itself, run php -S localhost:8080 -t public and open
http://localhost:8080/blog.