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

Registering MANY Partials at once #159

Open
marmz opened this issue Nov 6, 2016 · 1 comment
Open

Registering MANY Partials at once #159

marmz opened this issue Nov 6, 2016 · 1 comment

Comments

@marmz
Copy link

marmz commented Nov 6, 2016

I come from HandleBars.js, and i often used to store many Partials/Templates in one file (inside <script> tag), then get the ones i need using jQuery.

I would like to do the same thing on PHP, using phpQuery.
So, It could be nice to register Partials passing an Array of Strings when initializing the Engine.
Example:

[
   'partial_bold' => '<b>{{ this.value }}</b>' ,
   'partial_underline' => '<u>{{ this.value }}</u>', 
   'partial_italic' => '<i>{{ this.value }}</i>'
]

so you can call every Partial in your template by its name.
Example:

{{ > partial_underline }}

If someone is interested in this change and maybe can address me to where i should extend the code, i could try adding the feature.
If, instead, the author (Xamin Project) likes the idea and wants to do it by himself it would be great, of course ;)

@everplays
Copy link
Contributor

Have you tried the ArrayLoader?

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