- A lot of fixes done on this for a test project.

This commit is contained in:
mcndave committed 2021-02-16 03:10:04 +00:00
1 parent 52e55f2bba
commit 09b3e47c19
11 files changed
+78 -21

No files matched your search

+11 -4
View File
@@ -17,7 +17,8 @@ use Notes\Security\SecurityHandler;
use Notes\Tell\LanguageHandler;
use Picea\Extension\UrlExtension;
use Picea\Picea,
Picea\Extension\UrlExtension;
use Storage\Cookie,
Storage\Session;
@@ -75,8 +76,8 @@ class Routing {
# $container->set($class, autowire($class)->method($method, $request));
if ( null !== ( $annotation = $this->language->verify($class) ) ) {
if ( $annotation->key ) {
if ( null !== ( $languageAnnotation = $this->language->verify($class) ) ) {
if ( $languageAnnotation->key ) {
# TODO !!! $language
}
}
@@ -85,10 +86,16 @@ class Routing {
# Checking if user needs to be logged
if ( ! $object->user->logged && ( $redirect = $this->security->verify($class, $method) ) ) {
$this->session->redirectedFrom = (string) $request->getUri();
return $redirect;
}
return $object->$method($request, $arguments);
if ( $container->has(Picea::class) ) {
$container->get(Picea::class)->globalVariables['route'] = $annotation;
}
return $object->$method($request->withAttribute('lean.route', $annotation), $arguments);
});
}
}