mirror of
https://github.com/flarum/framework.git
synced 2024-11-28 03:32:49 +08:00
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.
This commit is contained in:
parent
98ea4d1e71
commit
94a62293eb
|
@ -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";
|
||||
|
||||
|
|
|
@ -127,6 +127,8 @@ class ClientView implements Renderable
|
|||
$this->assets = $assets;
|
||||
$this->layout = $layout;
|
||||
$this->localeJs = $localeJs;
|
||||
|
||||
$this->addHeadString('<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700,600">', '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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user