Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/233.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Laravel 4辅助类未自动加载_Php_Laravel_Laravel 4 - Fatal编程技术网

Php Laravel 4辅助类未自动加载

Php Laravel 4辅助类未自动加载,php,laravel,laravel-4,Php,Laravel,Laravel 4,我正在尝试使用Laravel 4中位于app/helpers文件夹中的helper类,但无论我做什么,Laravel都会给我错误找不到类 助手基类 Helper.php <?php /* Base Helper class! */ class Helpers { } Helper.php 发现了问题 在Gravatar.php中, <? class Gravatar extends Helpers { /** * Get either a Gravata

我正在尝试使用Laravel 4中位于
app/helpers
文件夹中的helper类,但无论我做什么,Laravel都会给我错误
找不到类

助手基类

Helper.php
<?php
/* 
    Base Helper class!
*/

class Helpers {

}
Helper.php
发现了问题

在Gravatar.php中,

<? 
class Gravatar extends Helpers {
 /**
     * Get either a Gravatar URL or complete image tag for a specified email address.
     *
     * @param string $email The email address
     * @param string $s Size in pixels, defaults to 80px [ 1 - 2048 ]
     * @param string $d Default imageset to use [ 404 | mm | identicon | monsterid | wavatar ]
     * @param string $r Maximum rating (inclusive) [ g | pg | r | x ]
     * @param boole $img True to return a complete IMG tag False for just the URL
     * @param array $atts Optional, additional key/value attributes to include in the IMG tag
     * @return String containing either just a URL or a complete image tag
     * @source http://gravatar.com/site/implement/images/php/
     */
    public static function get_gravatar( $email, $s = 80, $d = 'mm', $r = 'g', $img = false, $atts = array() ) {
        $url = 'http://www.gravatar.com/avatar/';
        $url .= md5( strtolower( trim( $email ) ) );
        $url .= "?s=$s&d=$d&r=$r";
        if ( $img ) {
            $url = '<img src="' . $url . '"';
            foreach ( $atts as $key => $val )
                $url .= ' ' . $key . '="' . $val . '"';
            $url .= ' />';
        }
        return $url;
    }
}
<img src="{{ Gravatar::get_gravatar($thread['user']['email'], 50) }}">