class
AzuCLI::Generate::Page
- AzuCLI::Generate::Page
- Teeplate::FileTree
- Reference
- Object
Overview
Page generator that creates Azu::Response structs for both Web and API projects
Defined in:
azu_cli/generators/page.crConstant Summary
-
OUTPUT_DIR =
"./src/pages"
Constructors
Class Method Summary
-
.output_dir_for_type(project_type : String) : String
Get the appropriate output directory based on project type All pages/responses are generated in ./src/pages directory
Instance Method Summary
-
#____collect_files(____files)
:nodoc:
- #__ecr0(____io)
- #__ecr2(____io)
- #action : String
- #action=(action : String)
-
#api_type : Bool
Check if this is an API project
-
#assignments_from_source : String
Get assignments from source type (e.g., User)
-
#constructor_params : String
Get constructor parameters for fields
-
#crystal_type(field_type : String) : String
Get Crystal type for field
-
#field_label(field_name : String) : String
Get field label
-
#field_placeholder(field_name : String) : String
Get field placeholder
-
#field_required?(field_name : String) : Bool
Check if field is required
- #fields : Hash(String, String)
- #fields=(fields : Hash(String, String))
-
#filter(entries)
Filter which template files to render based on project type
-
#form_action : String
Get form action URL
-
#form_classes : String
Get Bootstrap form classes
-
#form_method : String
Get form method
- #from_type : String | Nil
- #from_type=(from_type : String | Nil)
-
#from_var : String
Get the variable name for the source type
-
#full_module_name : String
Get the full nested module name for the page
- #generate_template : Bool
- #generate_template=(generate_template : Bool)
-
#getter_declarations : String
Get getter declarations
-
#html_input_type(field_type : String) : String
Get field type for HTML input
- #module_name : String
- #module_name=(module_name : String)
-
#module_path : String
Get module path from class name for template directory structure
- #name : String
- #name=(name : String)
-
#page_title : String
Get page title for the action
- #project_type : String
- #project_type=(project_type : String)
- #render(output_dir : String, force : Bool = false, interactive : Bool = true, list : Bool = false, color : Bool = false)
-
#render_method : String
Get render method based on project type
- #resource : String
- #resource=(resource : String)
- #resource_plural : String
- #resource_plural=(resource_plural : String)
- #resource_singular : String
- #resource_singular=(resource_singular : String)
- #snake_case_name : String
- #snake_case_name=(snake_case_name : String)
-
#struct_name : String
Convert name to page response struct name based on project type (nested under resource module)
-
#table_headers : String
Get table headers for index page
-
#table_row_template : String
Get table row template for index page
-
#template_filename : String
Get template filename for the action
-
#template_generator : AzuCLI::Generate::Template
Also generate Jinja2 HTML templates for web projects
-
#template_generator=(template_generator : AzuCLI::Generate::Template)
Also generate Jinja2 HTML templates for web projects
-
#template_path : String
Get full template path matching Azu framework expectations
-
#view_data_hash : String
Get view data hash for render method (web projects only)
-
#web_type : Bool
Check if this is a web project
Constructor Detail
Class Method Detail
Get the appropriate output directory based on project type All pages/responses are generated in ./src/pages directory
Instance Method Detail
Convert name to page response struct name based on project type (nested under resource module)
Also generate Jinja2 HTML templates for web projects
Also generate Jinja2 HTML templates for web projects