class

AzuCLI::Generate::Template

Inherits Teeplate::FileTree < Reference < Object

Inner class for generating Jinja2 HTML templates

Constants

OUTPUT_DIR = "./public/templates"

Constructors

new(name : String, fields : Hash(String, String), action : String, module_name : String = "App")
Source

Instance methods

____collect_files(____files)

:nodoc:

Source
__ecr0(____io)
Source
__ecr2(____io)
Source
__ecr4(____io)
Source
__ecr6(____io)
Source
__ecr8(____io)
Source
action
Source
action=(action : String)
Source
field_label(field_name : String) : String

Get field label

Source
field_placeholder(field_name : String) : String

Get field placeholder

Source
field_required?(field_name : String) : Bool

Check if field is required

Source
fields
Source
fields=(fields : Hash(String, String))
Source
filter(entries)

Filter which template files to render based on action

Source
form_action

Get form action URL

Source
form_classes

Get Bootstrap form classes

Source
form_method

Get form method

Source
html_input_type(field_type : String) : String

Get field type for HTML input

Source
module_name
Source
module_name=(module_name : String)
Source
module_path
Source
module_path=(module_path : String)
Source
name
Source
name=(name : String)
Source
page_title

Get page title for the action

Source
render(output_dir : String, force : Bool = false, interactive : Bool = true, list : Bool = false, color : Bool = false)

Override render to create proper directory structure

Source
resource
Source
resource=(resource : String)
Source
resource_plural
Source
resource_plural=(resource_plural : String)
Source
resource_singular
Source
resource_singular=(resource_singular : String)
Source
snake_case_name
Source
snake_case_name=(snake_case_name : String)
Source
template_filename

Get template filename for the action

Source
template_path

Get full template path matching Azu framework expectations

Source