Skip to content

Getting Started

Nana Axel edited this page Mar 30, 2018 · 8 revisions

Getting Started with Bubble

Installation

Bubble can be installed in your project through composer:

$ composer require na2axl/bubble

Once installed, you just have to use Bubble through the \Bubble namespace.

Creating your first bubble...

Bubble use a XML-like syntax to create and compile templates. A minimal bubble template will be:

<!DOCTYPE html>
<b:bubble xmlns:b="http://bubble.na2axl.tk/schema">
    <html lang="en">

        <head>
            <meta charset="UTF-8"/>
            <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
            <meta http-equiv="X-UA-Compatible" content="ie=edge"/>
            <title>Document</title>
        </head>

        <body>
            <b:text value="Hello, world!"/>
        </body>

    </html>
</b:bubble>

NOTE: All your templates have to be wrapped in the <b:bubble/> tags, and the value of the b namespace is http://bubble.na2axl.tk/schema

What next ?

  • Send data from PHP to templates with templates variables
  • Evaluate PHP code in templates
  • Bubble's functions in templates
  • Use of Bubble's tags
    • b:text
    • b:selectItems
    • b:dataTable
    • b:include
    • b:block
    • b:condition
    • b:for
    • b:foreach

Clone this wiki locally