如何在CakePHP中加载Google字体/在CakePHP 2.3.6中使用GoogleFontHelper

hem*_*ppa 1 cakephp

如何在CakePHP中加载Google字体?我找到了一个为CakePHP 2.0构建的帮助器.它在这里:http://plugins.cakephp.org/p/1277-CakePHP-Font-Plugin

但是当我尝试使用它将它集成到我的AppController中时:

public $helpers = array('Session','Html', 'Js', 'Form', 'GoogleFont');
Run Code Online (Sandbox Code Playgroud)

,结果是:

Strict (2048): Declaration of GoogleFontHelper::url() should be compatible with Helper::url($url = NULL, $full = false) [APP/View/Helper/GoogleFontHelper.php, line 50]
Run Code Online (Sandbox Code Playgroud)

那么这个GoogleFontHelper与CakePHP 2.3.6不兼容.

或者是否有另一种加载Google字体的方法?

472*_*084 7

我错过了什么,为什么你需要帮手?你不能这么做..

echo $this->Html->css('http://fonts.googleapis.com/css?family=Open+Sans:300,400,700');
Run Code Online (Sandbox Code Playgroud)

或者@import像kicaj所说的那样直接将它添加到你的css文件中.