-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
541 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sonata Project package. | ||
* | ||
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Sonata\AdminBundle\Admin; | ||
|
||
final class TemplateRegistry implements TemplateRegistryInterface | ||
{ | ||
private $templates = []; | ||
|
||
/** | ||
* TemplateRegistry constructor. | ||
* | ||
* @param array $templates | ||
*/ | ||
public function __construct(array $templates = []) | ||
{ | ||
$this->templates = $templates; | ||
} | ||
|
||
public function getTemplates() | ||
{ | ||
return $this->templates; | ||
} | ||
|
||
public function setTemplates(array $templates) | ||
{ | ||
$this->templates = $templates; | ||
} | ||
|
||
public function getTemplate($name) | ||
{ | ||
if (isset($this->templates[$name])) { | ||
return $this->templates[$name]; | ||
} | ||
} | ||
|
||
public function setTemplate($name, $template) | ||
{ | ||
$this->templates[$name] = $template; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sonata Project package. | ||
* | ||
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Sonata\AdminBundle\Admin; | ||
|
||
interface TemplateRegistryInterface | ||
{ | ||
/** | ||
* @return array | ||
*/ | ||
public function getTemplates(); | ||
|
||
public function setTemplates(array $templates); | ||
|
||
/** | ||
* @param string $name | ||
* | ||
* @return string | ||
*/ | ||
public function getTemplate($name); | ||
|
||
/** | ||
* @param string $name | ||
* @param string $template | ||
*/ | ||
public function setTemplate($name, $template); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.