PHP 8.1+
- Added the console command
routes:routes
(with aliasroutes
), androuting:actions
.
UrlTrait
can be used with prototyped objects to add a url()
method and a $url
property. The binding uses the UrlMethod
service to generate the urls.
<?php
namespace ICanBoogie;
use ICanBoogie\Binding\Routing\Prototype\UrlTrait;
class Article extends Prototyped
{
use UrlTrait;
// …
}
$article = new Article;
echo $article->url;
The prototype bindings can be inferred from the UrlGetter
attribute (defined by UrlTrait
) if olvlvl/composer-attribute-collector
is available.
<?php
// config/prototype.php
use ICanBoogie\Binding\Prototype\ConfigBuilder;
use ICanBoogie\Binding\Routing\Prototype\UrlMethod;
return fn(ConfigBuilder $config) => UrlMethod::bind($config);
- Because
ControllerAbstract
no longer extendsPrototyped
and services are now expected to be provided through the constructor,ControllerBindings
andForwardUndefinedPropertiesToApplication
have been removed. - Removed
ApplicationBindings
. RemovedApplication::url_for()
andApplication::get_routes()
prototype methods. Request the servicesUrlGenerator
andRouteProvider
instead.
None
None