Plugins

From struts4php

Jump to: navigation, search

Contents

Description

The plugins are written for the smarty template engine and does only work when the Web Container and a customized version of the Smarty Template Engine are used.

Tags

Actually three different types of tags exists:

  • bean tags
  • logic tags
  • struts tags

bean tags

bean_size_tag

This tag calculates the size of the Collection, defined by the parameters, and renders it's size.

bean_define_tag

This tag provides the functionality to register a object defined in some scope in the page scope, to make it accessable for other tags.

Usage:

{bean_define_tag id="person" name="personViewData" scope="request"}
Property Description Mandatory Type
id Holds the key to register the object in the page scope under. yes string
name Holds the name of the bean in the specified scope to register in the target scope. yes string
property Holds the property of the bean to register. no string
scope Holds the scope where the bean is located. The scope can one out of request, session or page. If no scope is specified, 'page' is assumed. no string
toScope Holds the target scope where the bean will be registered under. The scope can one out of request, session or page. If no scope is specified, 'page' is assumed. no string

bean_write_tag

This tag provides the functionality for rendering the value of the specified bean or the property of the specified bean into the template.

Usage:

{bean_define_tag id="person" name="personViewData" scope="request"}
{bean_write_tag name="person" property="firstname"}
Property Description Mandatory Type
name Holds the name of the bean in the specified scope to get the property from. yes string
property Holds the property of the bean to render the value. no string
scope Holds the scope where the bean is located. The scope can one out of request, session or page. If no scope is specified, 'page' is assumed. no string

logic tags

The logic tags are necessary to implement basic structures in your templates, e. g. to check if a object has the requested value you can use the logic_equal_tag:

{logic_equal_tag name="person" property="gender" type="integer" value="1"}male{/logic_equal_tag}
{logic_equal_tag name="person" property="gender" type="integer" value="2"}female{/logic_equal_tag}

logic_empty_tag

logic_not_empty_tag

logic_equal_tag

logic_not_equal_tag

logic_greater_than_tag

logic_greater_equal_tag

logic_lower_than_tag

logic_lower_equal_tag

struts tags

This tags are strongly related to the struts4php framework and accesses beans initialized and populated by the framework itself. Tags of this type are for example the struts_form_tag that grants access to a ActionForm defined in the configuration.

struts_form_tag

This tag initializes the ActionForm defined in the configuration in the page context. This is necessary to grant access to it's properties e. g. used by the struts_text_tag.

struts_checkbox_tag

This tag renders a HTML checkbox, that is selected, if the value specified in the corresponding ActionForm property is equal to the one specified as value parameter.

struts_button_tag

struts_hidden_tag

struts_html_tag

struts_img_tag

struts_option_tag

struts_options_tag

struts_radio_tag

struts_select_tag

struts_submit_tag

struts_text_tag

struts_textarea_tag

Links

Personal tools