Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Feature: Add PHP Pug as available templating systems inner installer #248

Closed
kpicaza opened this issue Mar 26, 2018 · 3 comments
Closed

Comments

@kpicaza
Copy link

kpicaza commented Mar 26, 2018

Hello,

I would like to propose as an add-on, the option to use PHP Pug https://github.com/pug-php/pug as a template engine.

I already have an adapter for Zend\Expressive\Template\TemplateRendererInterface working https://github.com/kpicaza/infw-pug.

On the other hand, I made a fork and i added the default templates and settings in the installer https://github.com/kpicaza/zend-expressive-skeleton/tree/feature/pug-template-renderer.

If you think it's a good idea, I'll be happy to do the pull request and create the corresponding documentation for the Expressive website.

Greetings.

@geerteltink
Copy link
Member

Although I appreciate the offer, I'm not sure if it's a good idea to add more packages. Specifically packages that are not stable yet. But that's just my opinion.

However that doesn't mean you can't use your package right now. There is a feature to install alternative packages: Instead of entering one of the selection you can actually type the package name and version.

  Which template engine do you want to use?
  [1] Plates
  [2] Twig
  [3] zend-view installs zend-servicemanager
  [n] None of the above
  Make your selection or type a composer package name and version (n): infw/pug:0.1
  - Searching for infw/pug:0.1
  - Adding package infw/pug (0.1)

That feature has been there from the beginning and it allows you to install any alternative package you want. It has its limitations though:

  • You need to enter the alternative package as namespace/package:1.0. It needs the version. I can't remember why I coded it like that, but I think it had to do with the way composer works or my limited composer api knowledge at that time :)
  • Templates are not copied, but you can configure your ConfigProvider in such way that it uses the default templates directly from the package itself.
  • This doesn't work for containers as the container.php file needs to be copied.

@kpicaza
Copy link
Author

kpicaza commented May 14, 2018

Thanks a lot for response. I have made already some adapters for my projects using pug with Expressive(and i'm happy with it;-D).

I love Zend Expressive and I would enjoy helping in anything that I can.

Best Regards.

@geerteltink
Copy link
Member

Closing this in favor of #267

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants