SproutCMS

This is the code documentation for the SproutCMS project

function setFieldNameFormat()

Set a format string which will alter the field name prior to being passed to the underlying render method

Formatting is done using sprintf
A single parameter is provided to the sprintf() call, the field name
The default format does no transformation, i.e. the string '%s'
This parameter persists across multiple form fields

Usage

void Form::setFieldNameFormat ( string $format );

Example

Form::setFieldNameFormat('pages[%s]')
Form::text('name')         // field name will be 'pages[text]'

Arguments

  1. string $format
    Format string

Return value

  • void