Skip to content

Commit

Permalink
- 3.0
Browse files Browse the repository at this point in the history
- Renamed MacdomLoader to FileLoader
- Updated cs
- Updated readme
  • Loading branch information
Machy8 committed Aug 22, 2017
1 parent 0f93cc6 commit 079b8ec
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,28 +78,30 @@ $compiled = $macdom->compile($content);
```PHP

use Macdom\Engine;
use Macdom\Bridges\MacdomLatte\MacdomLoader;
use Macdom\Bridges\MacdomLatte\FileLoader;

/**
* @var Engine
*/
private $macdom;

/**
* @var MacdomLoader
* @var FileLoader
*/
private $macdom;
private $fileLoader;

public function __construct(Engine $macdom, MacdomLoader $macdomLoader) {

public function __construct(Engine $macdom, FileLoader $fileLoader) {
$this->macdom = $macdom;
$this->macdomLoader = $macdom;
$this->fileLoader = $fileLoader;
}


protected function createTemplate()
{
$template = parent::createTemplate();
$this->macdomLoader->setMacdom($this->macdom);
$template->getLatte()->setLoader($this->macdomLoader);
$this->fileLoader->setMacdom($this->macdom);
$template->getLatte()->setLoader($this->fileLoader);
return $template;
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@

namespace Macdom\Bridges\MacdomLatte;

use Latte\Loaders\FileLoader;
use Latte\Loaders\FileLoader as LatteFileLoader;
use Macdom\Engine;


final class MacdomLoader extends FileLoader
final class FileLoader extends LatteFileLoader
{

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Bridges/MacdomNette/MacdomExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function loadConfiguration()
$config = $this->getConfig($this->config);

$builder->addDefinition($this->prefix('loader'))
->setClass('Macdom\Bridges\MacdomLatte\MacdomLoader');
->setClass('Macdom\Bridges\MacdomLatte\FileLoader');

$compiler = $builder->addDefinition($this->prefix('engine'))
->setClass('Macdom\Engine');
Expand Down
8 changes: 6 additions & 2 deletions src/Macdom/Compiler/Register.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,16 @@ public function removeBooleanAttribute($booleanAttribute, string $contentType =

if ($isXhtmlContentType) {
if ($this->findBooleanAttribute($booleanAttributeToRemove, Engine::CONTENT_HTML)) {
$booleanAttributeKey = array_search($booleanAttributeToRemove, $this->booleanAttributes[Engine::CONTENT_HTML]);
$booleanAttributeKey = array_search(
$booleanAttributeToRemove, $this->booleanAttributes[Engine::CONTENT_HTML]
);
unset($this->booleanAttributes[Engine::CONTENT_HTML][$booleanAttributeKey]);
}

if ($this->findBooleanAttribute($booleanAttributeToRemove, Engine::CONTENT_XML)) {
$booleanAttributeKey = array_search($booleanAttributeToRemove, $this->booleanAttributes[Engine::CONTENT_XML]);
$booleanAttributeKey = array_search(
$booleanAttributeToRemove, $this->booleanAttributes[Engine::CONTENT_XML]
);
unset($this->booleanAttributes[Engine::CONTENT_HTML][$booleanAttributeKey]);
}

Expand Down

0 comments on commit 079b8ec

Please sign in to comment.