This repository has been archived by the owner on Jan 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 132
Using Dynamic Partial Names #171
Comments
Maybe: (In HandleBars.js it works fine ...) |
tried as well... doesn't seem to be working.
|
Hi.. Maybe you would like to take a look at:
"LightNCandy" (by Zordius)
https://github.com/zordius/lightncandy
In my opinion it is the best HandleBars port on PHP ... it has a (quite)
perfect compatibily .. For example supports "pseudo" properties as:
@root, @Index, @key
and other..
And you can specify a huge amount of FLAGS, so you can choose to use its
own functionality, as well as Moustache or Handlebars standards.
I could also recommend "LightNCandy" for its high performances (see the
benchmarks reported by author himself) ..
I wrote u by mail because don't want to discourage XaminProject :)
Hope this helps!
Bye.
Dario
Il 18 lug 2017 1:40 PM, "RadicalWeb" <[email protected]> ha scritto:
tried as well... doesn't seem to be working.
I've also tried creating a helper but with no luck..
<?php
/**
* This file is part of Handlebars-php
*
* PHP version 5.3
*
* @category Xamin
* @Package Handlebars
* @author fzerorubigd <[email protected]>
* @author Behrooz Shabani <[email protected]>
* @author Dmitriy Simushev <[email protected]>
* @author Jeff Turcotte <[email protected]>
* @copyright 2014 Authors
* @license MIT <http://opensource.org/licenses/MIT>
* @Version GIT: $Id$
* @link http://xamin.ir
*/
namespace Handlebars\Helper;
use Handlebars\Context;
use Handlebars\Helper;
use Handlebars\Template;
use Handlebars\Handlebars;
/**
* The DynPart Helper
*
* @category Xamin
* @Package Handlebars
* @author Salvovac <[email protected]>
* @copyright 2014 Authors
* @license MIT <http://opensource.org/licenses/MIT>
* @Version Release: @package_version@
* @link http://xamin.ir
*/
class DynPartHelper implements Helper
{
/**
* Execute the helper
*
* @param \Handlebars\Template $template The template instance
* @param \Handlebars\Context $context The current context
* @param array $args The arguments passed the the helper
* @param string $source The source
*
* @return mixed
*/
public function execute(Template $template, Context $context,
$args, $source)
{
$name=$context->get($args);
try{
$h=$template->getEngine();
$partial=$h->loadPartial($name);
$buffer=$partial->render($context);
}catch(Exception $e){
}
return $buffer;
}
}
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#171 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ATB1wT4hFManY4-xR0XVKV41-gRPdTFfks5sPJm0gaJpZM4ObLaS>
.
|
Hi Dario,
Thanks for the info, I found the issue.
In a version update I ended up overwriting the handlebars folder and this removed a previously added helper import call from the function addDefaultHelpers() in Helpers.php
All is working fine now :D
Thanks,
Salvo
From: marmz <[email protected]>
Reply-To: "XaminProject/handlebars.php" <[email protected]>
Date: Tuesday 18 July 2017 at 14:45
To: "XaminProject/handlebars.php" <[email protected]>
Cc: Salvo Vaccarino <[email protected]>, Author <[email protected]>
Subject: Re: [XaminProject/handlebars.php] Using Dynamic Partial Names (#171)
Hi.. Maybe you would like to take a look at:
"LightNCandy" (by Zordius)
https://github.com/zordius/lightncandy
In my opinion it is the best HandleBars port on PHP ... it has a (quite)
perfect compatibily .. For example supports "pseudo" properties as:
@root, @Index, @key
and other..
And you can specify a huge amount of FLAGS, so you can choose to use its
own functionality, as well as Moustache or Handlebars standards.
I could also recommend "LightNCandy" for its high performances (see the
benchmarks reported by author himself) ..
I wrote u by mail because don't want to discourage XaminProject :)
Hope this helps!
Bye.
Dario
Il 18 lug 2017 1:40 PM, "RadicalWeb" <[email protected]> ha scritto:
tried as well... doesn't seem to be working.
I've also tried creating a helper but with no luck..
<?php
/**
* This file is part of Handlebars-php
*
* PHP version 5.3
*
* @category Xamin
* @Package Handlebars
* @author fzerorubigd <[email protected]>
* @author Behrooz Shabani <[email protected]>
* @author Dmitriy Simushev <[email protected]>
* @author Jeff Turcotte <[email protected]>
* @copyright 2014 Authors
* @license MIT <http://opensource.org/licenses/MIT>
* @Version GIT: $Id$
* @link http://xamin.ir
*/
namespace Handlebars\Helper;
use Handlebars\Context;
use Handlebars\Helper;
use Handlebars\Template;
use Handlebars\Handlebars;
/**
* The DynPart Helper
*
* @category Xamin
* @Package Handlebars
* @author Salvovac <[email protected]>
* @copyright 2014 Authors
* @license MIT <http://opensource.org/licenses/MIT>
* @Version Release: @package_version@
* @link http://xamin.ir
*/
class DynPartHelper implements Helper
{
/**
* Execute the helper
*
* @param \Handlebars\Template $template The template instance
* @param \Handlebars\Context $context The current context
* @param array $args The arguments passed the the helper
* @param string $source The source
*
* @return mixed
*/
public function execute(Template $template, Context $context,
$args, $source)
{
$name=$context->get($args);
try{
$h=$template->getEngine();
$partial=$h->loadPartial($name);
$buffer=$partial->render($context);
}catch(Exception $e){
}
return $buffer;
}
}
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#171 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ATB1wT4hFManY4-xR0XVKV41-gRPdTFfks5sPJm0gaJpZM4ObLaS>
.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FXaminProject%2Fhandlebars.php%2Fissues%2F171%23issuecomment-316068130&data=01%7C01%7Csalvo.vaccarino%40radical.ie%7Cb20915f94f204838398e08d4cde335a9%7C0c1331ba3895419fad1c01a3a5716d11%7C1&sdata=qaD8xcYfygP2CBIVVoB1wMWyhEvhKlSr12WOz0FJmzA%3D&reserved=0>, or mute the thread<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABTpMeoP8BJeVj-e2iG1upwWX0xs1mu2ks5sPLbjgaJpZM4ObLaS&data=01%7C01%7Csalvo.vaccarino%40radical.ie%7Cb20915f94f204838398e08d4cde335a9%7C0c1331ba3895419fad1c01a3a5716d11%7C1&sdata=yvZk5YH0UyeRBwc6bjASuE8gUEnjz%2F9aOSAkRPomNdY%3D&reserved=0>.
|
Ok...fine!
..... Comunque possiamo anche parlare in Italiano... se vuoi ;)
Il 18 lug 2017 4:18 PM, "RadicalWeb" <[email protected]> ha scritto:
… Hi Dario,
Thanks for the info, I found the issue.
In a version update I ended up overwriting the handlebars folder and this
removed a previously added helper import call from the function
addDefaultHelpers() in Helpers.php
All is working fine now :D
Thanks,
Salvo
From: marmz ***@***.***>
Reply-To: "XaminProject/handlebars.php" ***@***.***>
Date: Tuesday 18 July 2017 at 14:45
To: "XaminProject/handlebars.php" ***@***.***>
Cc: Salvo Vaccarino ***@***.***>, Author <
***@***.***>
Subject: Re: [XaminProject/handlebars.php] Using Dynamic Partial Names
(#171)
Hi.. Maybe you would like to take a look at:
"LightNCandy" (by Zordius)
https://github.com/zordius/lightncandy
In my opinion it is the best HandleBars port on PHP ... it has a (quite)
perfect compatibily .. For example supports "pseudo" properties as:
@root, @Index, @key
and other..
And you can specify a huge amount of FLAGS, so you can choose to use its
own functionality, as well as Moustache or Handlebars standards.
I could also recommend "LightNCandy" for its high performances (see the
benchmarks reported by author himself) ..
I wrote u by mail because don't want to discourage XaminProject :)
Hope this helps!
Bye.
Dario
Il 18 lug 2017 1:40 PM, "RadicalWeb" ***@***.***> ha
scritto:
tried as well... doesn't seem to be working.
I've also tried creating a helper but with no luck..
<?php
/**
* This file is part of Handlebars-php
*
* PHP version 5.3
*
* @category Xamin
* @Package Handlebars
* @author fzerorubigd ***@***.***>
* @author Behrooz Shabani ***@***.***>
* @author Dmitriy Simushev ***@***.***>
* @author Jeff Turcotte ***@***.***>
* @copyright 2014 Authors
* @license MIT <http://opensource.org/licenses/MIT>
* @Version GIT: $Id$
* @link http://xamin.ir
*/
namespace Handlebars\Helper;
use Handlebars\Context;
use Handlebars\Helper;
use Handlebars\Template;
use Handlebars\Handlebars;
/**
* The DynPart Helper
*
* @category Xamin
* @Package Handlebars
* @author Salvovac ***@***.***>
* @copyright 2014 Authors
* @license MIT <http://opensource.org/licenses/MIT>
* @Version Release: @package_version@
* @link http://xamin.ir
*/
class DynPartHelper implements Helper
{
/**
* Execute the helper
*
* @param \Handlebars\Template $template The template instance
* @param \Handlebars\Context $context The current context
* @param array $args The arguments passed the the helper
* @param string $source The source
*
* @return mixed
*/
public function execute(Template $template, Context $context,
$args, $source)
{
$name=$context->get($args);
try{
$h=$template->getEngine();
$partial=$h->loadPartial($name);
$buffer=$partial->render($context);
}catch(Exception $e){
}
return $buffer;
}
}
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#171 (comment)-
316038386>,
or mute the thread
<https://github.com/notifications/unsubscribe-
auth/ATB1wT4hFManY4-xR0XVKV41-gRPdTFfks5sPJm0gaJpZM4ObLaS>
.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://emea01.
safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.
com%2FXaminProject%2Fhandlebars.php%2Fissues%2F171%23issuecomment-
316068130&data=01%7C01%7Csalvo.vaccarino%40radical.ie%
7Cb20915f94f204838398e08d4cde335a9%7C0c1331ba3895419fad1c01a3a571
6d11%7C1&sdata=qaD8xcYfygP2CBIVVoB1wMWyhEvhKlSr12WOz0FJmzA%3D&reserved=0>,
or mute the thread<https://emea01.safelinks.protection.outlook.
com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%
2FABTpMeoP8BJeVj-e2iG1upwWX0xs1mu2ks5sPLbjgaJpZ
M4ObLaS&data=01%7C01%7Csalvo.vaccarino%40radical.ie%
7Cb20915f94f204838398e08d4cde335a9%7C0c1331ba3895419fad1c01a3a571
6d11%7C1&sdata=yvZk5YH0UyeRBwc6bjASuE8gUEnjz%2F9aOSAkRPomNdY%3D&reserved=0
>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#171 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ATB1wXMqhZo2q2kIQ8DERhu-X8ApTtUVks5sPL6tgaJpZM4ObLaS>
.
|
Perfetto!
Grazie! :D
From: marmz <[email protected]>
Reply-To: "XaminProject/handlebars.php" <[email protected]>
Date: Tuesday 18 July 2017 at 15:20
To: "XaminProject/handlebars.php" <[email protected]>
Cc: Salvo Vaccarino <[email protected]>, Author <[email protected]>
Subject: Re: [XaminProject/handlebars.php] Using Dynamic Partial Names (#171)
Ok...fine!
..... Comunque possiamo anche parlare in Italiano... se vuoi ;)
Il 18 lug 2017 4:18 PM, "RadicalWeb" <[email protected]> ha scritto:
Hi Dario,
Thanks for the info, I found the issue.
In a version update I ended up overwriting the handlebars folder and this
removed a previously added helper import call from the function
addDefaultHelpers() in Helpers.php
All is working fine now :D
Thanks,
Salvo
From: marmz ***@***.***>
Reply-To: "XaminProject/handlebars.php" ***@***.***>
Date: Tuesday 18 July 2017 at 14:45
To: "XaminProject/handlebars.php" ***@***.***>
Cc: Salvo Vaccarino ***@***.***>, Author <
***@***.***>
Subject: Re: [XaminProject/handlebars.php] Using Dynamic Partial Names
(#171)
Hi.. Maybe you would like to take a look at:
"LightNCandy" (by Zordius)
https://github.com/zordius/lightncandy
In my opinion it is the best HandleBars port on PHP ... it has a (quite)
perfect compatibily .. For example supports "pseudo" properties as:
@root, @Index, @key
and other..
And you can specify a huge amount of FLAGS, so you can choose to use its
own functionality, as well as Moustache or Handlebars standards.
I could also recommend "LightNCandy" for its high performances (see the
benchmarks reported by author himself) ..
I wrote u by mail because don't want to discourage XaminProject :)
Hope this helps!
Bye.
Dario
Il 18 lug 2017 1:40 PM, "RadicalWeb" ***@***.***> ha
scritto:
tried as well... doesn't seem to be working.
I've also tried creating a helper but with no luck..
<?php
/**
* This file is part of Handlebars-php
*
* PHP version 5.3
*
* @category Xamin
* @Package Handlebars
* @author fzerorubigd ***@***.***>
* @author Behrooz Shabani ***@***.***>
* @author Dmitriy Simushev ***@***.***>
* @author Jeff Turcotte ***@***.***>
* @copyright 2014 Authors
* @license MIT <http://opensource.org/licenses/MIT>
* @Version GIT: $Id$
* @link http://xamin.ir
*/
namespace Handlebars\Helper;
use Handlebars\Context;
use Handlebars\Helper;
use Handlebars\Template;
use Handlebars\Handlebars;
/**
* The DynPart Helper
*
* @category Xamin
* @Package Handlebars
* @author Salvovac ***@***.***>
* @copyright 2014 Authors
* @license MIT <http://opensource.org/licenses/MIT>
* @Version Release: @package_version@
* @link http://xamin.ir
*/
class DynPartHelper implements Helper
{
/**
* Execute the helper
*
* @param \Handlebars\Template $template The template instance
* @param \Handlebars\Context $context The current context
* @param array $args The arguments passed the the helper
* @param string $source The source
*
* @return mixed
*/
public function execute(Template $template, Context $context,
$args, $source)
{
$name=$context->get($args);
try{
$h=$template->getEngine();
$partial=$h->loadPartial($name);
$buffer=$partial->render($context);
}catch(Exception $e){
}
return $buffer;
}
}
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#171 (comment)-
316038386>,
or mute the thread
<https://github.com/notifications/unsubscribe-
auth/ATB1wT4hFManY4-xR0XVKV41-gRPdTFfks5sPJm0gaJpZM4ObLaS>
.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://emea01.
safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.
com%2FXaminProject%2Fhandlebars.php%2Fissues%2F171%23issuecomment-
316068130&data=01%7C01%7Csalvo.vaccarino%40radical.ie%
7Cb20915f94f204838398e08d4cde335a9%7C0c1331ba3895419fad1c01a3a571
6d11%7C1&sdata=qaD8xcYfygP2CBIVVoB1wMWyhEvhKlSr12WOz0FJmzA%3D&reserved=0>,
or mute the thread<https://emea01.safelinks.protection.outlook.
com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%
2FABTpMeoP8BJeVj-e2iG1upwWX0xs1mu2ks5sPLbjgaJpZ
M4ObLaS&data=01%7C01%7Csalvo.vaccarino%40radical.ie%
7Cb20915f94f204838398e08d4cde335a9%7C0c1331ba3895419fad1c01a3a571
6d11%7C1&sdata=yvZk5YH0UyeRBwc6bjASuE8gUEnjz%2F9aOSAkRPomNdY%3D&reserved=0
>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#171 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ATB1wXMqhZo2q2kIQ8DERhu-X8ApTtUVks5sPL6tgaJpZM4ObLaS>
.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FXaminProject%2Fhandlebars.php%2Fissues%2F171%23issuecomment-316079180&data=01%7C01%7Csalvo.vaccarino%40radical.ie%7C0f037ce0e5ff4c11e78408d4cde834be%7C0c1331ba3895419fad1c01a3a5716d11%7C1&sdata=WLysro6%2Bk2wO74ntA6VTvFtrDboFph2OTPA7NkH0X1g%3D&reserved=0>, or mute the thread<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABTpMSEE5q-QzembOnQAIVBvE-fObZ1oks5sPL9FgaJpZM4ObLaS&data=01%7C01%7Csalvo.vaccarino%40radical.ie%7C0f037ce0e5ff4c11e78408d4cde834be%7C0c1331ba3895419fad1c01a3a5716d11%7C1&sdata=31uvhJBxMlgVLMeBPoL7gO%2FZ%2B3httaL5gqxa%2FQsR69s%3D&reserved=0>.
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
I'm trying to load partial dynamically
{{#each metaData.sections}}
{{#if this.type}}
{{> this.type}}
{{/if}}
{{/each}}
but I get a ERR_CONTENT_DECODING_FAILED error on chrome, does anybody have any idea of what the issue could be?
I've tried various solutions but nothing seems to be working
{{> (this.type)}}
{{> ({{this.type}})}}
{{> "this.type"}}
{{> (lookup . 'this.type'}}
Nothing seems to do the trick.
Any suggestions?
The text was updated successfully, but these errors were encountered: