From 609c1ef7ba0e765b28b9d70def5dcea9763be941 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 20 Jun 2016 18:33:12 +0900 Subject: [PATCH] =?UTF-8?q?=E7=84=A1=E9=A7=84=E3=81=ABRouter::url=E3=82=92?= =?UTF-8?q?=E5=91=BC=E3=81=B0=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=80=81NetCommonsHtml->image=E3=81=A7block?= =?UTF-8?q?=5Fid=E7=AD=89=E3=82=92=E3=82=BB=E3=83=83=E3=83=88=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3=20https:?= =?UTF-8?q?//github.com/NetCommons3/NetCommons3/issues/161?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- View/Helper/LinkButtonHelper.php | 2 +- View/Helper/NetCommonsHtmlHelper.php | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/View/Helper/LinkButtonHelper.php b/View/Helper/LinkButtonHelper.php index 7878fa39..ccd84445 100644 --- a/View/Helper/LinkButtonHelper.php +++ b/View/Helper/LinkButtonHelper.php @@ -57,7 +57,7 @@ public function add($title = '', $url = null, $options = array()) { $url['controller'] = $this->_View->viewVars['addActionController']; } } - $url = NetCommonsUrl::actionUrl(Hash::merge($defaultUrl, $url)); + $url = NetCommonsUrl::actionUrlAsArray(Hash::merge($defaultUrl, $url)); } //Linkオプションの設定 diff --git a/View/Helper/NetCommonsHtmlHelper.php b/View/Helper/NetCommonsHtmlHelper.php index 163f9bfc..f2a8897f 100644 --- a/View/Helper/NetCommonsHtmlHelper.php +++ b/View/Helper/NetCommonsHtmlHelper.php @@ -152,7 +152,7 @@ private function __getUrl($url = null) { if (! isset($url['frame_id']) && Current::read('Frame.id')) { $url['frame_id'] = Current::read('Frame.id'); } - $url = NetCommonsUrl::actionUrl($url); + $url = NetCommonsUrl::actionUrlAsArray($url); } return $url; } @@ -187,6 +187,20 @@ public function link($title = '', $url = null, $options = array()) { return $output; } +/** + * ``タグの出力 + * + * @param mixed $path URL + * @param array $options HTML属性オプション + * @return string ``タグ + * @link http://book.cakephp.org/2.0/ja/core-libraries/helpers/html.html#HtmlHelper::image + */ + public function image($path, $options = array()) { + $path = $this->__getUrl($path); + $output = $this->Html->image($path, $options); + return $output; + } + /** * タイトル(ブロックタイトル)の出力 * @@ -252,7 +266,7 @@ public function editLink($title = '', $url = null, $options = array()) { if (! isset($url['frame_id']) && Current::read('Frame.id')) { $url['frame_id'] = Current::read('Frame.id'); } - $url = NetCommonsUrl::actionUrl($url); + $url = NetCommonsUrl::actionUrlAsArray($url); return $this->Html->link($title, $url, $options); }