Child classes:
- HTMLText
- Represents a large text field that contains HTML content.
Source Location: /sapphire/core/model/fieldtypes/Text.php
Inheritance: Object < ViewableData < DBField < StringField < Text
Summary: Represents a variable-length string of up to 2 megabytes, designed to store raw text
public
AbsoluteLinks ( )
|
Return the value of the field with relative links converted to absolute urls. |
public
BigSummary ( [$maxWords = 50], [$plain = 1] )
|
Performs the same function as the big summary, but doesnt trim new paragraphs off data. |
public
ContextSummary ( [$characters = 500], [$string = false], [$striphtml = true], [$highlight = true], [$prefix = "... "], [$suffix = "..."] )
|
Perform context searching to give some context to searches, optionally highlighting the search term. |
public
EscapeXML ( )
|
Return the value of the field with XML tags escaped. |
public
FirstParagraph ( [$plain = 1] )
|
Caution: Not XML/HTML-safe - does not respect closing tags. |
public
FirstSentence ( )
|
Caution: Not XML/HTML-safe - does not respect closing tags. |
public
LimitCharacters ( [$limit = 20], [$add = "..."] )
|
Limit this field's content by a number of characters. |
public
LimitSentences ( [$sentCount = 2] )
|
Limit sentences, can be controlled by passing an integer. |
public
LimitWordCount ( [$numWords = 26], [$add = '...'] )
|
Limit this field's content by a number of words. |
public
LimitWordCountXML ( [$numWords = 26], [$add = '...'] )
|
Limit the number of words of the current field's content. This is XML safe, so characters like & are converted to & |
public
NoHTML ( )
|
Return the value of the field stripped of html tags |
public
Parse ( [$parser = "TextParser"] )
|
Allows a sub-class of TextParser to be rendered. |
public
requireField ( )
|
(non-PHPdoc) |
public
scaffoldFormField ( [$title = null], [$params = null] )
|
(non-PHPdoc) |
public
scaffoldSearchField ( [$title = null], [$params = null] )
|
(non-PHPdoc) |
public
Summary ( [$maxWords = 50] )
|
Caution: Not XML/HTML-safe - does not respect closing tags. |
public
static $casting
|
protected
StringField::$nullifyEmpty
|
|
protected
DBField::$arrayValue
|
|
protected
DBField::$defaultVal
|
|
public
DBField::$default_search_filter_class
|
|
public
DBField::$escape_type
|
|
protected
DBField::$name
|
|
protected
DBField::$tableName
|
|
protected
DBField::$value
|
|
protected
ViewableData::$customisedObject
|
|
public
ViewableData::$default_cast
|
|
protected
ViewableData::$failover
|
|
protected
ViewableData::$iteratorPos
|
|
protected
ViewableData::$iteratorTotalItems
|
|
public
Object::$class
|
|
public
Object::$extensions
|
|
protected
Object::$extension_instances
|
Represents a variable-length string of up to 2 megabytes, designed to store raw text
Example definition via DataObject::$db:
[ Top ]
string AbsoluteLinks(
)
[line 88]
Return the value of the field with relative links converted to absolute urls.
[ Top ]
void BigSummary(
[
$maxWords = 50], [
$plain = 1])
[line 210]
Performs the same function as the big summary, but doesnt trim new paragraphs off data.
Caution: Not XML/HTML-safe - does not respect closing tags.
$maxWords
-
$plain
-
[ Top ]
string ContextSummary(
[int
$characters = 500], [boolean
$string = false], [boolean
$striphtml = true], [boolean
$highlight = true], [String
$prefix = "... "], [String
$suffix = "..."])
[line 286]
Perform context searching to give some context to searches, optionally highlighting the search term.
$characters
- Number of characters in the summary
$string
- Supplied string ("keywords")
$striphtml
- Strip HTML?
$highlight
- Add a highlight <span> element around search query?
$prefix
- prefix text
$suffix
- suffix
[ Top ]
string EscapeXML(
)
[line 80]
Return the value of the field with XML tags escaped.
[ Top ]
void FirstParagraph(
[
$plain = 1])
[line 248]
Caution: Not XML/HTML-safe - does not respect closing tags.
$plain
-
[ Top ]
void FirstSentence(
)
[line 147]
Caution: Not XML/HTML-safe - does not respect closing tags.
[ Top ]
string LimitCharacters(
[int
$limit = 20], [string
$add = "..."])
[line 101]
Limit this field's content by a number of characters.
CAUTION: Does not take into account HTML tags, so it has the potential to return malformed HTML.
$limit
- Number of characters to limit by
$add
- Ellipsis to add to the end of truncated string
[ Top ]
void LimitSentences(
[int
$sentCount = 2])
[line 124]
Limit sentences, can be controlled by passing an integer.
$sentCount
- The amount of sentences you want.
[ Top ]
string LimitWordCount(
[int
$numWords = 26], [string
$add = '...'])
[line 55]
Limit this field's content by a number of words.
CAUTION: This is not XML safe. Please use LimitWordCountXML() instead.
$numWords
- Number of words to limit by
$add
- Ellipsis to add to the end of truncated string
[ Top ]
string LimitWordCountXML(
[int
$numWords = 26], [string
$add = '...'])
[line 115]
Limit the number of words of the current field's content. This is XML safe, so characters like & are converted to &
$numWords
- Number of words to limit by
$add
- Ellipsis to add to the end of truncated string
[ Top ]
string NoHTML(
)
[line 73]
Return the value of the field stripped of html tags
[ Top ]
string Parse(
[
$parser = "TextParser"])
[line 332]
Allows a sub-class of TextParser to be rendered.
$parser
-
[ Top ]
void requireField(
)
[line 40]
(non-PHPdoc)
[ Top ]
void scaffoldFormField(
[
$title = null], [
$params = null])
[line 348]
(non-PHPdoc)
$title
-
$params
-
[ Top ]
void scaffoldSearchField(
[
$title = null], [
$params = null])
[line 362]
(non-PHPdoc)
$title
-
$params
-
[ Top ]
void Summary(
[
$maxWords = 50])
[line 163]
Caution: Not XML/HTML-safe - does not respect closing tags.
$maxWords
-
[ Top ]
[line 21]
Type: mixed
Overrides: Array
[ Top ]
Comments
Comment policy: Please use comments for tips and corrections about the described functionality. Comments are moderated, we reserve the right to remove comments that are inappropriate or are no longer relevant.
blog comments powered by DisqusUse the Silverstripe Forum to ask questions.