Compare commits

...
7 Commits
Author SHA1 Message Date
Adam Engebretson f62269629b Merge pull request #96 from patrickbrouwers/patch-1
HtmlBuilder shouldn't depend on concrete implementation
2015-11-28 02:27:09 -06:00
Adam Engebretson 2516472b3f Merge pull request #97 from patrickbrouwers/patch-2
Don't depend on concretes in FormBuilder
2015-11-28 02:26:44 -06:00
Adam Engebretson 828da38dcd Merge pull request #100 from jackmcdade/5.1
dl() now supports multiple descriptions per term
2015-11-28 02:26:21 -06:00
Jack McDade acb21a9364 correct code formatting 2015-10-23 17:47:44 -04:00
Jack McDade b5d6fdedb6 dl() now supports multiple descriptions per term 2015-10-23 17:45:01 -04:00
Patrick Brouwers 9ab4568241 Don't depend on concretes in FormBuilder 2015-10-08 10:08:07 +02:00
Patrick Brouwers 575d891b64 HtmlBuilder shouldn't depend on concrete implementation 2015-10-08 09:56:16 +02:00
2 changed files with 18 additions and 12 deletions

No files matched your search

+8 -8
View File
@@ -3,8 +3,8 @@
namespace Collective\Html; namespace Collective\Html;
use DateTime; use DateTime;
use Illuminate\Routing\UrlGenerator; use Illuminate\Contracts\Routing\UrlGenerator;
use Illuminate\Session\Store as Session; use Illuminate\Session\SessionInterface;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Illuminate\Support\Traits\Macroable; use Illuminate\Support\Traits\Macroable;
@@ -22,7 +22,7 @@ class FormBuilder
/** /**
* The URL generator instance. * The URL generator instance.
* *
* @var \Illuminate\Routing\UrlGenerator * @var \Illuminate\Contracts\Routing\UrlGenerator
*/ */
protected $url; protected $url;
@@ -36,7 +36,7 @@ class FormBuilder
/** /**
* The session store implementation. * The session store implementation.
* *
* @var \Illuminate\Session\Store * @var \Illuminate\Session\SessionInterface
*/ */
protected $session; protected $session;
@@ -78,7 +78,7 @@ class FormBuilder
/** /**
* Create a new form builder instance. * Create a new form builder instance.
* *
* @param \Illuminate\Routing\UrlGenerator $url * @param \Illuminate\Contracts\Routing\UrlGenerator $url
* @param \Collective\Html\HtmlBuilder $html * @param \Collective\Html\HtmlBuilder $html
* @param string $csrfToken * @param string $csrfToken
* *
@@ -1130,7 +1130,7 @@ class FormBuilder
/** /**
* Get the session store implementation. * Get the session store implementation.
* *
* @return \Illuminate\Session\Store $session * @return \Illuminate\Session\SessionInterface $session
*/ */
public function getSessionStore() public function getSessionStore()
{ {
@@ -1140,11 +1140,11 @@ class FormBuilder
/** /**
* Set the session store implementation. * Set the session store implementation.
* *
* @param \Illuminate\Session\Store $session * @param \Illuminate\Session\SessionInterface $session
* *
* @return $this * @return $this
*/ */
public function setSessionStore(Session $session) public function setSessionStore(SessionInterface $session)
{ {
$this->session = $session; $this->session = $session;
+10 -4
View File
@@ -2,7 +2,7 @@
namespace Collective\Html; namespace Collective\Html;
use Illuminate\Routing\UrlGenerator; use Illuminate\Contracts\Routing\UrlGenerator;
use Illuminate\Support\Traits\Macroable; use Illuminate\Support\Traits\Macroable;
class HtmlBuilder class HtmlBuilder
@@ -12,14 +12,14 @@ class HtmlBuilder
/** /**
* The URL generator instance. * The URL generator instance.
* *
* @var \Illuminate\Routing\UrlGenerator * @var \Illuminate\Contracts\Routing\UrlGenerator
*/ */
protected $url; protected $url;
/** /**
* Create a new HTML builder instance. * Create a new HTML builder instance.
* *
* @param \Illuminate\Routing\UrlGenerator $url * @param \Illuminate\Contracts\Routing\UrlGenerator $url
* *
* @return void * @return void
*/ */
@@ -294,7 +294,13 @@ class HtmlBuilder
$html = "<dl{$attributes}>"; $html = "<dl{$attributes}>";
foreach ($list as $key => $value) { foreach ($list as $key => $value) {
$html .= "<dt>$key</dt><dd>$value</dd>"; $value = (array) $value;
$html .= "<dt>$key</dt>";
foreach ($value as $v_key => $v_value) {
$html .= "<dd>$v_value</dd>";
}
} }
$html .= '</dl>'; $html .= '</dl>';