質問編集履歴
2
変更
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
cakephp3で何か投稿してフラッシュメソッドで文字列を表示したときに、そこにリンクのタグを張りたいのですが、
|
1
|
+
cakephp3で何か投稿してフラッシュメソッドで文字列を表示したときに、そこにリンクのタグを張りたいのですが、エスケープ処理されているようで、タグが使えません。
|
2
2
|
|
3
3
|
どうしたらよいでしょうか。
|
4
4
|
|
1
追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,3 +1,26 @@
|
|
1
1
|
cakephp3で何か投稿してフラッシュメソッドで文字列を表示したときに、そこにリンクのタグを張りたいのですが、サニタイジング処理されているようで、タグが使えません。
|
2
2
|
|
3
|
-
どうしたらよいでしょうか。
|
3
|
+
どうしたらよいでしょうか。
|
4
|
+
|
5
|
+
```PHP
|
6
|
+
public function add()
|
7
|
+
{
|
8
|
+
$this->ViewBuilder()->layout('auth');
|
9
|
+
|
10
|
+
|
11
|
+
$article = $this->Articles->newEntity();
|
12
|
+
if ($this->request->is('post')) {
|
13
|
+
$article = $this->Articles->patchEntity($article, $this->request->data);
|
14
|
+
if ($this->Articles->save($article)) {
|
15
|
+
$this->Flash->success(__('投稿成功'));//ここにリンクタグを作りたい。
|
16
|
+
|
17
|
+
return $this->redirect(['action' => 'add']);
|
18
|
+
} else {
|
19
|
+
$this->Flash->error(__('投稿エラー'));
|
20
|
+
}
|
21
|
+
}
|
22
|
+
$users = $this->Articles->Users->find('list', ['limit' => 200]);
|
23
|
+
$this->set(compact('article', 'users'));
|
24
|
+
$this->set('_serialize', ['article']);
|
25
|
+
}
|
26
|
+
```
|