From 90437016ea72d61b0596520838efdecf81c064c6 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Tue, 12 Jan 2016 18:29:21 +1030 Subject: [PATCH] Extract Google font import to a head string, make overideable Allowing headStrings to be named is a bit of a stopgap solution. Really ClientView needs to be given much more power with headStrings and footStrings as separate objects, similar to the ItemList in the JS app. --- framework/core/less/lib/lib.less | 2 -- framework/core/src/Http/Controller/ClientView.php | 10 ++++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/framework/core/less/lib/lib.less b/framework/core/less/lib/lib.less index b942aa28d..45396ecd3 100755 --- a/framework/core/less/lib/lib.less +++ b/framework/core/less/lib/lib.less @@ -1,5 +1,3 @@ -@import url(//fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700,600); - @import "font-awesome.less"; @fa-font-path: "../../assets/fonts"; diff --git a/framework/core/src/Http/Controller/ClientView.php b/framework/core/src/Http/Controller/ClientView.php index b5f786b1c..97554de88 100644 --- a/framework/core/src/Http/Controller/ClientView.php +++ b/framework/core/src/Http/Controller/ClientView.php @@ -127,6 +127,8 @@ class ClientView implements Renderable $this->assets = $assets; $this->layout = $layout; $this->localeJs = $localeJs; + + $this->addHeadString('', 'font'); } /** @@ -164,9 +166,13 @@ class ClientView implements Renderable * * @param string $string */ - public function addHeadString($string) + public function addHeadString($string, $name = null) { - $this->headStrings[] = $string; + if ($name) { + $this->headStrings[$name] = $string; + } else { + $this->headStrings[] = $string; + } } /**