Skip to content
Alex Torscho edited this page Jan 11, 2015 · 1 revision

In /vendor/atorscho/backend/src/helpers folder you may find several files:

  • misc.php: other functions.
  • outputs.php: all functions that output an HTML.
  • users.php: functions that have direct relation to users.

Misc

  1. toObjects(): recursively converts nested arrays to nested objects of stdClass.
  2. getSetting(): returns the value of a setting handle stored in settings DB table.
  3. index(): simply increments a static variable with each call. Useful for counters and tabindex HTML attributes.
  4. getDateFormat(): outputs a date in a date format specified in Settings.
  5. getDateTimeFormat(): outputs a date in a datetime format specified in Settings.
  6. datetimePicker(): outputs a datetime in a format that DatetimePicker jQuery plugin uses.
  7. saveCustomField(): created rules and field names from custom field names.
  8. counter(): a counter for paginated pages. You can see an example on Users page.
  9. transIfExists(): the function that is used to dynamically display a localized or normal string in FlashHelper and TemplateHelper.

Outputs

  1. flash(): a helper to output the Flash Message alert.
  2. customFieldInput(): a function that outputs a correct input depending on the field type and options.
  3. iconList(): simply returns an array of all Font-Awesome icons.

Users

  1. addPermissionsToGroup(): attach permissions to specified group.
  2. in(): check whether the authenticated user is in specified group.
  3. can(): check whether the authenticated user has specific permission.

Clone this wiki locally