LemonStand Wiki

API (function, action and class reference)

This sections contains details about LemonStand classes and functions.

Helper functions

Helper functions are PHP functions which help you to build websites in LemonStand.

  • checkbox_state - returns checked="checked" string if its parameter is TRUE. Useful for programming form checkboxes.
  • content_block - inserts editable content block into a page
  • customer_logout - closes current customer session and redirects browser to a specified location.
  • flash_message - returns a message previously set by a page action.
  • format_currency - returns a number in currency format.
  • h - returns string in HTML-safe format, replacing < with &lt; and so on.
  • include_resources - outputs HTML links to JavaScript and CSS libraries required for LemonStand AJAX framework
  • open_form - outputs HTML FORM tag with the ACTION attribute pointing to a current page (by default).
  • option_state - outputs string 'selected="selected"' if the first parameter matches the second parameter. Useful for programming SELECT elements.
  • post - returns an element from the POST array by its name (key). Allows to specify a default value for the case if the specified element not found.
  • radio_state - alias for the checkbox_state function, use it for programming radio buttons.
  • root_url - returns an URL of a specified resource relative to the LemonStand domain root
  • site_url - outputs an absolute URL to a specified website page.
  • tax_incl_label - returns the tax included label text, for example "including GST"

JavaScript framework

LemonStand JavaScript framework allows you to send AJAX requests to the server and update page content without reloading the whole page.

Common classes

Common classes are provided by the programming framework.

  • Db_ActiveRecord - base database record management class.
  • Db_DataCollection - represents a set of database records.
  • Db_File - represents a file (or image) in the LemonStand database.
  • Phpr_DateTime - class for working with date/time values.
  • Phpr_Pagination - helps in creating pagination of database objects.
  • Phpr_Response - the class which you can use for managing the HTTP response and for redirecting the browser to a specific page.

CMS module classes

Classes included to the LemonStand CMS module. You can access the controller and page objects in the page, partials, templates and actions code.

Shop module classes

Classes provided by the Shop module. You can access these classes on your pages, partials and templates to load data about eCommerce objects - products, categories, customers and so on.

Shop module actions

Actions provided by the Shop module. 

Shop module common AJAX handlers

A list of AJAX handlers which do not belong to a specific action, and can be called from any page. 

Next: checkbox_state
Previous: Building your online store
Return to Developer's Guide

Comments

No comments posted so far.

Add your comment

Loading form...