dongyoulou4829 2018-08-16 13:30
浏览 113

Laravel刀片删除字符串限制

How can I remove the string limit when I display it in the blade?

I tried str_limit($details, $limit = -1) and str_limit($details, $limit = 1000000)

But still limiting the string when displayed.

EDIT

Controller

$announcement = DB::table('announcement')
            ->where([
                    'status' => 1,
                    'delete' => 0,
                ])
            ->where('display_date', '<=', date('Y-m-d'))
            ->leftJoin('users','announcement.user_id','=','users.id')
            ->leftJoin('user_details','users.user_details_id','=','user_details.id')
            ->orderBy('display_date', 'DESC')
            ->orderBy('announcement.created_at', 'DESC')
            ->get();

$data['announcement'] = $announcement;

return view( $this->viewpath . 'index' )->with( $data );

BLADE

@foreach($announcement as $index => $val)
  <div class="a_body">
     <h3 class="a_title">{{ $val->announcement_title }}</h3>
     <div class="a_details">{{ $val->announcement_details}}</div>
     <div class="a_posted">Posted Date: {{$val->display_date}}</div>
     <div class="a_created">By:{{ $val->first_name }} {{ $val->last_name }}</div>
  </div>
@endforeach
  • 写回答

1条回答 默认 最新

  • duangang3832 2018-08-16 15:12
    关注

    The issue is likely to do with the database rather than Laravel. Laravel does not limit the string unless you use str_limit, so removing this code is a good start.

    If your string is being limited, then check that the database is storing your full string in the first place. If your database code is using VARCHAR, you may be limiting your strings to the default 255 character length. Changing this to TEXT would let you store up to ~64k of data.

    评论

报告相同问题?

悬赏问题

  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line