diff --git a/src/BobDBuilder/Cmd/Traits/Make/Domain.php b/src/BobDBuilder/Cmd/Traits/Make/Domain.php index b3b59ab..1135928 100644 --- a/src/BobDBuilder/Cmd/Traits/Make/Domain.php +++ b/src/BobDBuilder/Cmd/Traits/Make/Domain.php @@ -133,7 +133,7 @@ public function init_pages(): void public function pages(): void { - \$this->builder->route("index")->bind(function (ViewBuilder \$builder) { + \$this->route("index")->bind(function (ViewBuilder \$builder) { \$builder->page("title", "Homepage") ->page("desc", "This is the default homepage description") ->assets( @@ -142,7 +142,7 @@ public function pages(): void ->body("homepage"); }); - \$this->builder->route("another-page")->bind(function (ViewBuilder \$builder) { + \$this->route("another-page")->bind(function (ViewBuilder \$builder) { \$builder->page("title", "Another Page") ->page("desc", "This is another page's description") ->assets( diff --git a/src/Core/Traits/Resources.php b/src/Core/Traits/Resources.php index e451642..280e101 100644 --- a/src/Core/Traits/Resources.php +++ b/src/Core/Traits/Resources.php @@ -1,10 +1,8 @@ 'string', - "lay_static" => 'string', - "framework" => 'string', - "framework_workers" => 'string', - "workers" => 'string', - "root" => 'string', - "temp" => 'string', - "exceptions" => 'string', - "cron_outputs" => 'string', - "bricks" => 'string', - "db" => 'string', - "utils" => 'string', - "web" => 'string', - "shared" => 'string', - "domains" => 'string', - "uploads" => 'string', - "uploads_no_root" => 'string', - ])] + /** + * @psalm-return object{ + * lay: string, + * lay_static: string, + * framework: string, + * framework_workers: string, + * workers: string, + * root: string, + * temp: string, + * exceptions: string, + * cron_outputs: string, + * bricks: string, + * db: string, + * utils: string, + * web: string, + * shared: string, + * domains: string, + * uploads: string, + * uploads_no_root: string + * } + */ public static function server_data() : object { if(!isset(self::$server)){ @@ -105,23 +105,31 @@ public static function server_data() : object } - #[ObjectShape([ - "base" => 'string', - "proto" => 'string', - "base_no_proto" => 'string', - "base_no_proto_no_www" => 'string', - "domain" => 'string', - "domain_no_proto" => 'string', - "domain_no_proto_no_www" => 'string', - "server_mocked" => 'bool', - "author" => 'string', - "global_api" => 'string', - "name" => 'object[long, short]', - "color" => 'object[pry, sec]', - "mail" => 'object[0,1,...n]', - "tel" => 'object[0,1,...n]', - "others" => 'object', - ])] + /** + * @psalm-return object{ + * base: string, + * proto: string, + * base_no_proto: string, + * base_no_proto_no_www: string, + * domain: string, + * domain_no_proto: string, + * domain_no_proto_no_www: string, + * server_mocked: bool, + * author: string, + * global_api: string, + * name: object{ + * long : string, + * short: string + * }, + * color: object{ + * pry: string, + * sec: string + * }, + * mail: object, + * tel: object, + * others: object + * } + */ public static function site_data() : object { self::is_init(true); diff --git a/src/Core/View/Tags/Link.php b/src/Core/View/Tags/Link.php index 5a68957..7645845 100644 --- a/src/Core/View/Tags/Link.php +++ b/src/Core/View/Tags/Link.php @@ -46,10 +46,11 @@ public function href(string $href, bool $print = true, bool $lazy = false): stri $as = $this->attr['as'] ?? "style"; $rel = $this->attr['rel'] ?? "stylesheet"; $type = $this->attr['type'] ?? "text/css"; - $lazy_type = $this->attr['lazy'] ?? "prefetch"; // 'preload' || 'prefetch'; $attr = $this->get_attr(function ($v, $k) use ($lazy) { - if (($lazy && $k == "rel") || $k == "src") + + if (($lazy && ($k == "rel" || $k == "media" || $k == "type")) || $k == "src") { return CustomContinueBreak::CONTINUE; + } return $v; }); @@ -58,10 +59,10 @@ public function href(string $href, bool $print = true, bool $lazy = false): stri if ($lazy) { $attr = <<"; + $link = "\n\t\n\t"; } if ($print)