class AzuCLI::Generate::Template

Overview

Inner class for generating Jinja2 HTML templates

Defined in:

azu_cli/generators/template.cr

Constant Summary

OUTPUT_DIR = "./public/templates"

Constructors

Instance Method Summary

Constructor Detail

def self.new(name : String, fields : Hash(String, String), action : String, module_name : String = "App") #

[View source]

Instance Method Detail

def ____collect_files(____files) #
Description copied from class Teeplate::FileTree

:nodoc:


[View source]
def __ecr0(____io) #

[View source]
def __ecr2(____io) #

[View source]
def __ecr4(____io) #

[View source]
def __ecr6(____io) #

[View source]
def __ecr8(____io) #

[View source]
def action : String #

[View source]
def action=(action : String) #

[View source]
def field_label(field_name : String) : String #

Get field label


[View source]
def field_placeholder(field_name : String) : String #

Get field placeholder


[View source]
def field_required?(field_name : String) : Bool #

Check if field is required


[View source]
def fields : Hash(String, String) #

[View source]
def fields=(fields : Hash(String, String)) #

[View source]
def form_action : String #

Get form action URL


[View source]
def form_classes : String #

Get Bootstrap form classes


[View source]
def form_method : String #

Get form method


[View source]
def html_input_type(field_type : String) : String #

Get field type for HTML input


[View source]
def module_name : String #

[View source]
def module_name=(module_name : String) #

[View source]
def module_path : String #

[View source]
def module_path=(module_path : String) #

[View source]
def name : String #

[View source]
def name=(name : String) #

[View source]
def page_title : String #

Get page title for the action


[View source]
def render(output_dir : String, force : Bool = false, interactive : Bool = true, list : Bool = false, color : Bool = false) #

Override render to create proper directory structure


[View source]
def resource : String #

[View source]
def resource=(resource : String) #

[View source]
def resource_plural : String #

[View source]
def resource_plural=(resource_plural : String) #

[View source]
def resource_singular : String #

[View source]
def resource_singular=(resource_singular : String) #

[View source]
def snake_case_name : String #

[View source]
def snake_case_name=(snake_case_name : String) #

[View source]
def template_filename : String #

Get template filename for the action


[View source]
def template_path : String #

Get full template path matching Azu framework expectations


[View source]