Branch Code
As of March 2017, Branch Code is deprecated and no longer developed. Use the Twig syntax instead.
The magic behind layouts and templates is a system of Branch Code, which allows you to pull in content and format it for whatever design your site has.
Branch Code consists of variables, logic constructs like if/else/elseif statements, foreach loops, for loops, special core tags and variable modifiers.
The idea behind creating Branch Code included a few main thoughts.
- We wanted to be security conscious and not allow any raw PHP code to be executed in our hosted environment.
- Make it easy to mix logic code with HTML.
- Try to create a language that would be less intimidating and easier to use for non-developers.
- There were certain common pieces of code that we could abstract out so that the resulting Branch Code was very short. The json variable modifier is an example of this.
While item #4 was accomplished for many scenarios there are admittedly some scenarios where more Branch Code is needed compared to raw PHP.
To give credit where credit is due, we were inspired by the work of Expression Engine and PHP Smarty code.