/PHPHump

A framework which has an ability to separate PHP and HTML.

Primary LanguagePHP

PHPHump

This framework is designed and authored, with an aim to separate PHP and HTML. Usually it is a messy task to understand PHP and HTML in combined state. This framework allows you to have a clean environment, while working on code base whether it is production and staging. It support no. of features like dynamic templating, dynamic assigning, variable definition, html switching etc.

Installation

composer require sahil-gulati/phphump

OR

{
    "require":{
        "sahil-gulati/phphump": "1.0.2"
    }
}

composer install

Traditional way

<html>
  <head>
    <title>My Page</title>
  </head>
  <body>
    <div>
    <?php 
    foreach($someVariable as $value)
    {
      echo "<p class='someClass'> $value </p>";
    }
    ?>
    </div>
  </body>
  </html>

Hump style

<html>
  <head>
    <title>My Page</title>
  </head>
  <body>
    <div>
    <p class='someClass' hump-loop="someVariable as value"> 
      #[value]# 
    </p>
    </div>
  </body>
  </html>

Modules

1. Attributes

  1. Hump-If
  2. Hump-Loop
  3. Hump-Attribute
  4. Hump-While

2. Tags

  1. HumpAssign
  2. HumpTemplate
  3. HumpRequire
  4. HumpSwitch

Contributors

  1. @SahilGulati

Feedback

Your feedback at my implementation will be highly appreciated. For any further requirements, support and issues while implementation, You can directly drop me an email at sahil.gulati1991@outlook.com and I will be back to you. :)