使用Laravel 5在文本区域中编写链接和新行


Write link and New lines in a textarea with Laravel 5

我需要发送一封邀请邮件。文本为:

你好,伙计,

点击此链接加入我们的锦标赛:http://link.to.registration.with.token

首先,我管理国际化,所以我得到的是:

'invite_template' => 'Hi Mate, 'r'n Click the link :link ',

$message = trans('crud.invite_template', ['link' => '<a href="http://link.with.token">link</a>' ]);

然后:

  {!!  Form::textarea('message',nl2br(e($message)), ['class' => 'form-control']) !!}

但这是我的问题:

  1. I 'r'n更改为<BR />,因此Textarea看起来很糟糕
  2. 链接也显示在HTML中,而不是被解释

有可能这样做吗???

您可以通过两种方式来实现

方法1:在文本编辑器中打印文本内容

步骤1:包括ckeditor.js

<script src="{{ asset('/').('public/lib/ckeditor/ckeditor.js') }}"></script>  

然后

第2步:编写文本

<textarea class="ckeditor">{{ $yourTextContent }}</textarea>

方法2:回声输入

只做

echo $yourContent;