-
-
Notifications
You must be signed in to change notification settings - Fork 415
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #60 Php templates (weaverryan)
This PR was squashed before being merged into the 1.0-dev branch (closes #60). Discussion ---------- Php templates This depends on #59. So sorry for the messy diff until that is merged: tl;dr; This renders the templates as PHP, instead of simple `{{ foo }}` find and replace. We do not want to make the templates super dynamic and fancy, but we're already running into a few spots where we're hitting this limitation (case: `make:controller` which has *two* possible templates, because the current replace is too limiting). The only ugly part is that the `<?php` in the templates needs to be written as `//PHP_OPEN` to avoid syntax errors (we then replace this with `<?php` after including). Here is an example: https://github.com/symfony/maker-bundle/compare/master...weaverryan:php-templates?expand=1#diff-3ecc33834a0f1ec4f8e5516d71e4ad35 Btw, if you're wondering "Why not use Twig!?". We don't want to create a dependency on Twig to use the maker :). Cheers! Commits ------- 8fe5462 Php templates
- Loading branch information
Showing
33 changed files
with
120 additions
and
118 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
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
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
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
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
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
6 changes: 3 additions & 3 deletions
6
...es/skeleton/controller/Controller.php.txt → ...es/skeleton/controller/Controller.tpl.php
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
6 changes: 3 additions & 3 deletions
6
...ton/controller/ControllerWithTwig.php.txt → ...ton/controller/ControllerWithTwig.tpl.php
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
6 changes: 3 additions & 3 deletions
6
...esources/skeleton/doctrine/Entity.php.txt → ...esources/skeleton/doctrine/Entity.tpl.php
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 was deleted.
Oops, something went wrong.
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,28 @@ | ||
<?= "<?php\n" ?> | ||
|
||
namespace App\Repository; | ||
|
||
use App\Entity\<?= $entity_class_name ?>; | ||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; | ||
use Symfony\Bridge\Doctrine\RegistryInterface; | ||
|
||
class <?= $repository_class_name ?> extends ServiceEntityRepository | ||
{ | ||
public function __construct(RegistryInterface $registry) | ||
{ | ||
parent::__construct($registry, <?= $entity_class_name ?>::class); | ||
} | ||
|
||
/* | ||
public function findBySomething($value) | ||
{ | ||
return $this->createQueryBuilder('<?= $entity_alias ?>') | ||
->where('<?= $entity_alias ?>.something = :value')->setParameter('value', $value) | ||
->orderBy('<?= $entity_alias ?>.id', 'ASC') | ||
->setMaxResults(10) | ||
->getQuery() | ||
->getResult() | ||
; | ||
} | ||
*/ | ||
} |
This file was deleted.
Oops, something went wrong.
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,21 @@ | ||
<?= "<?php\n" ?> | ||
|
||
namespace App\EventSubscriber; | ||
|
||
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | ||
<?= $eventClass ? "use $eventClass;\n" : '' ?> | ||
|
||
class <?= $subscriber_class_name ?> implements EventSubscriberInterface | ||
{ | ||
public function <?= $methodName ?>(<?= $eventArg ?>) | ||
{ | ||
// ... | ||
} | ||
|
||
public static function getSubscribedEvents() | ||
{ | ||
return [ | ||
'<?= $event ?>' => '<?= $methodName ?>', | ||
]; | ||
} | ||
} |
Oops, something went wrong.