kyleparisi / protex

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Protex

You Must Construct Additional Pylons!

A naive and simple framework for myself.

Usage

Setup

mix deps.get
cp .env.default .env
# update .env with your apps details

Server

bash local.sh
# open localhost:4000/health

Testing

Testing requires docker and mysql clients in your terminal.

bash test.sh

Tasks

bash cli.sh clean_old_sessions

Views

There is special syntax to render views similar to Laravel's blade templates. Otherwise, EEx template syntax should work.

Data

Data in templates use the following syntax.

{{ @name || "" }}

Include

Include a template in the current template.

<%= @include.("includes.footer") %>

Extends

Extend a layout template with the current template.

<%= @extends.("layouts.marketing") %>

Yield

Render a named "section".

<%= @yield.("content") %>

Section

Section is used to define content of yield statements.

<%= @section.("content") %>
    <div>Hello world!</div>
<%= @endsection.() %>

Foreach

<%= @foreach.("item <- @items") %>
    {{ item["name"] }}
<%= @endforeach.() %>

About


Languages

Language:Elixir 65.9%Language:HTML 27.3%Language:CSS 3.7%Language:Shell 2.6%Language:JavaScript 0.5%