Laravel遇到了一个非常好的数值

时间:2017-05-28 07:50:21

标签: laravel

我在laravel 5.2中遇到错误

  

Helpers.php第616行中的ErrorException:       遇到一个格式不正确的数值(查看:C:\ laragon \ www \ trunqd-dev \ resources \ views \ post \ postCard.blade.php)(查看:C:\ laragon \ www \ trunqd-dev \ resources \ views \ post \ postCard.blade.php)(查看:C:\ laragon \ www \ trunqd-dev \ resources \ views \ post \ postCard.blade.php)(查看:C:\ laragon \ www \ trunqd-dev \ resources \视图\交\ postCard.blade.php)

my helpers.php

/**
 * Store a newly created resource in storage.
 *
 * @param  $width
 * @param  $height
 * @param  get Image ratio
 * @return Response
 */
function imageRatio($width, $height, $flag = 0, $fixWidth = 218)
{
    $n_width = $width > $fixWidth ? $fixWidth : $width;
    if(!empty($height) && !empty($width)){
        $n_height = floor(($height/$width)*$n_width);
        if ($flag == 2) {
            $n_height = floor($n_width * 9) / 16;
        }
    }else{
        $n_height = 160;
    }

    if($flag == 1){
        return array('width' => $n_width, 'height' => $n_height);
    } 

    return "width:" . $n_width . "px;height:" . $n_height . "px;";
}

我使用的是php 7.0。请协助我不知道为什么我会遇到这个错误。

0 个答案:

没有答案