V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
slove
V2EX  ›  问与答

下面是一段上传图片,然后使用标题生成链接,只支持英文和数字,望懂的人帮忙处理下,让他支持中文标题

  •  
  •   slove · 2014-06-09 14:51:40 +08:00 · 2796 次点击
    这是一个创建于 3615 天前的主题,其中的信息可能已经有所发展或是发生改变。
    $photo = new photo();
    $photo->title = $input['upload_title'];
    $photo->slug = Str::slug($input['upload_title']);
    $photo->belongs_to = $input['belongs_to'];
    $photo->credits = strlen($input['credits']) > 0 ? $input['credits'] : '';
    $photo->photo_url = $randomName;
    $photo->type = 'image';
    $photo->user_id = Auth::user()->id;
    $photo->read_count = 0;
    $photo->is_approved = ((int) Settings::first()->autoapprove_photos === 0) ? 0 : 1;
    $photo->is_featured = 0;
    $photo->save();

    return Response::json(array(
    'status' => 'success',
    'message' => trans('app.upload_success'),
    'redirect_to' => \URL::to('photo/' . Str::slug($input['upload_title']))
    ));
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   740 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 21:11 · PVG 05:11 · LAX 14:11 · JFK 17:11
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.