/ Published in: PHP
This is just a test
Expand |
Embed | Plain Text
<?php /* * BACKEND * Populate the value of the required data structure of the template */ // if provider=pg and number = 0 then the backend should output [ { "price":"Not Available", "discounts": "", "free_shipping":"", "buttons":[] } ] // if provider=pg and number > 0 then the backend should output [ { "price":"$1,200", "discounts": "20% Discounts", "free_shipping":"Free Shipping", "buttons":[{'btn_see_it':{'link':'http://google.com'}}] } ] /* FRONTEND * The template should have a logic less so we just ouput the price * */ The price is : {{price}} The discount is : {{discount}} The shipping is : {{free_shipping}} {{#buttons.btn_see_it}} {{> btn_see_it}} // found out that mustache has a so called "partials" which acts to include another template {{/buttons.btn_see_it}} ?>
You need to login to post a comment.
