HtmlWriter

Extends\Writer

Contains functions and properties that are common to all writers.

All extending classes must implement the internalWrite(...) method and have access to functionality as described below:

TODO Write more docs here

package

Default

Methods

close

close()

closeTag

closeTag()

closeTags

closeTags()

Returns an abbreviated heading for the survey's question that matches Force headingTextLength to be set, set to 15 if is not set (old behaviour)

getAbbreviatedHeading(\SurveyObj $oSurvey,\FormattingOptions $oOptions,string $fieldName): string
inherited

Arguments

$oSurvey

\SurveyObj

$oOptions

\FormattingOptions

$fieldName

string

Response

string

Return the subquestion part, if not empty : add a space before it.

getFullFieldSubHeading(\SurveyObj $oSurvey,\FormattingOptions $oOptions,string $fieldName): string
inherited

Arguments

$oSurvey

\SurveyObj

$oOptions

\FormattingOptions

$fieldName

string

Response

string

Returns a full heading for the question that matches the $fieldName.

getFullHeading(\SurveyObj $oSurvey,\FormattingOptions $oOptions,string $fieldName): string
inherited

Force headingTextLength to null (old behaviour)

deprecated

Arguments

$oSurvey

\SurveyObj

$oOptions

\FormattingOptions

$fieldName

string

Response

string

Return the question text part without any subquestion

getFullQuestionHeading(\SurveyObj $oSurvey,\FormattingOptions $oOptions,string $fieldName): string
inherited

Arguments

$oSurvey

\SurveyObj

$oOptions

\FormattingOptions

$fieldName

string

Response

string

Return the question code according to options

getHeadingCode(\SurveyObj $oSurvey,\FormattingOptions $oOptions,string $fieldName): string
inherited

Arguments

$oSurvey

\SurveyObj

$oOptions

\FormattingOptions

$fieldName

string

Response

string

Return the question text according to options

getHeadingText(\SurveyObj $oSurvey,\FormattingOptions $oOptions,string $fieldName): string
inherited

Arguments

$oSurvey

\SurveyObj

$oOptions

\FormattingOptions

$fieldName

string

Response

string

Return the answer text according to options

getLongAnswer(\SurveyObj $oSurvey,\FormattingOptions $oOptions,string $fieldName,string $sValue): string
inherited

Arguments

$oSurvey

\SurveyObj

$oOptions

\FormattingOptions

$fieldName

string

$sValue

string

Response

string

Return the answer text according to options

getShortAnswer(\SurveyObj $oSurvey,\FormattingOptions $oOptions,string $fieldName,string $sValue): string
inherited

Arguments

$oSurvey

\SurveyObj

$oOptions

\FormattingOptions

$fieldName

string

$sValue

string

Response

string

An initialization method that implementing classes can override to gain access to any information about the survey, language, or formatting options they may need for setup.

init(\SurveyObj $oSurvey,mixed $sLanguageCode,\FormattingOptions $oOptions)
inherited

Arguments

$oSurvey

\SurveyObj

$sLanguageCode

mixed

$oOptions

\FormattingOptions

openTag

openTag(string $tag, $options = array())

Arguments

$tag

string

$options

out

out(string $content)

Arguments

$content

string

This method will be called once for every row of data that needs to be output.

outputRecord(array $headers,array $values,\FormattingOptions $oOptions)
inheritedabstract

Implementations must use the data from these method calls to construct proper output for their output type and the given FormattingOptions.

Arguments

$headers

array

$values

array

$oOptions

\FormattingOptions

Renders a question and recurses into subquestions.

renderQuestion(\Question $question,string $value, $header)

Arguments

$question

\Question

$value

string

$header

Return map of questions groups

setGroupMap(\SurveyObj $survey,\FormattingOptions $oOptions): array
inherited

Arguments

$survey

\SurveyObj

$oOptions

\FormattingOptions

Response

array

stripTagsFull

stripTagsFull( $string)
inherited

Arguments

$string

tag

tag(string $tag, $options = array(),string $content = null)

Arguments

$tag

string

$options

$content

string

Performs a transformation of the response value based on the value, the type of field the value is a response for, and the FormattingOptions.

transformResponseValue(string $value,string $fieldType,\FormattingOptions $oOptions,string $column = null): string
inherited

All transforms should be processed during the execution of this function!

The final step in the transform is to apply a stripTagsFull on the $value. This occurs for ALL values whether or not any other transform is applied.

Arguments

$value

string

$fieldType

string

$oOptions

\FormattingOptions

$column

string

The name of the column

Response

string

translate

translate( $key, $sLanguageCode)
inherited

Arguments

$key

$sLanguageCode

This method is made final to prevent extending code from circumventing the initialization process that must take place prior to any of the translation infrastructure to work.

write(\SurveyObj $oSurvey,string $sLanguageCode,\FormattingOptions $oOptions,boolean $bOutputHeaders = true)
inheritedfinal

The inialization process is dependent upon the survey being passed into the write function and so must be performed when the method is called and not prior to (such as in a constructor).

All extending classes must implement the internalWrite function which is the code that is called after all initialization is completed.

Arguments

$oSurvey

\SurveyObj

$sLanguageCode

string

$oOptions

\FormattingOptions

$bOutputHeaders

boolean

Set if header should be given back

writeHeader

writeHeader()

Properties

The open filehandle

handle :

Type(s)

first

first :

Type(s)

groupMap

groupMap :

Type(s)

options

options :\FormattingOptions
var

Type(s)

\FormattingOptions

survey

survey :\SurveyObj
var

Type(s)

\SurveyObj

Manages stack of open HTML tags that need closing.

stack :

Type(s)

sLanguageCode

sLanguageCode :
inherited

Type(s)

translator

translator :\Translator
inherited
var

Type(s)

\Translator

filename

filename :
inherited

Type(s)

webfilename

webfilename :
inherited

Type(s)