Webylon 3.1 API Docs
  • Package
  • Class
  • Tree
  • Deprecated
  • Download
Version: current
  • 3.2
  • 3.1

Packages

  • auth
  • Booking
  • cart
    • shipping
    • steppedcheckout
  • Catalog
  • cms
    • assets
    • batchaction
    • batchactions
    • bulkloading
    • comments
    • content
    • core
    • export
    • newsletter
    • publishers
    • reports
    • security
    • tasks
  • Dashboard
  • DataObjectManager
  • event
  • faq
  • forms
    • actions
    • core
    • fields-basic
    • fields-dataless
    • fields-datetime
    • fields-files
    • fields-formatted
    • fields-formattedinput
    • fields-relational
    • fields-structural
    • transformations
    • validators
  • googlesitemaps
  • guestbook
  • installer
  • newsletter
  • None
  • photo
    • gallery
  • PHP
  • polls
  • recaptcha
  • sapphire
    • api
    • bulkloading
    • control
    • core
    • cron
    • dev
    • email
    • fields-formattedinput
    • filesystem
    • formatters
    • forms
    • i18n
    • integration
    • misc
    • model
    • parsers
    • search
    • security
    • tasks
    • testing
    • tools
    • validation
    • view
    • widgets
  • seo
    • open
      • graph
  • sfDateTimePlugin
  • spamprotection
  • stealth
    • captha
  • subsites
  • userform
    • pagetypes
  • userforms
  • webylon
  • widgets

Classes

  • ArrayLib
  • BBCodeParser
  • Convert
  • Cookie
  • DataDifferencer
  • Geoip
  • HTMLCleaner
  • HTTP
  • i18n
  • Profiler
  • ShortcodeParser
  • SSHTMLBBCodeParser
  • SSHTMLBBCodeParser_Filter
  • SSHTMLBBCodeParser_Filter_Basic
  • SSHTMLBBCodeParser_Filter_EmailLinks
  • SSHTMLBBCodeParser_Filter_Extended
  • SSHTMLBBCodeParser_Filter_Images
  • SSHTMLBBCodeParser_Filter_Links
  • SSHTMLBBCodeParser_Filter_Lists
  • TextParser
  • Translatable_Transformation
  • XML

Class TextParser

Parses text in a variety of ways.

Called from a template by $Content.Parse(SubClassName), similar to $Content.XML. This will work on any Text database field (Or a sub-class, such as HTMLText, although it's usefulness in this situation is more limited).

Any sub-classes of TextParser must implement a parse() method. This should take $this->content and parse it however you want. For an example of the implementation, @see BBCodeParser.

Your sub-class will be initialized with a string of text, then parse() will be called. parse() should (after processing) return the formatted string.

Note: $this->content will have NO conversions applied to it. You should run Covert::raw2xml or whatever is appropriate before using it.

Optionally (but recommended), is creating a static usable_tags method, which will return a DataObjectSet of all the usable tags that can be parsed. This will (mostly) be used to create helper blocks - telling users what things will be parsed. Again, @see BBCodeParser for an example of the syntax

Object
Extended by TextParser

Direct known subclasses

BBCodeParser

Abstract
Package: sapphire\misc
Located at sapphire/parsers/TextParser.php

Methods summary

public
# __construct( string $content = "" )

Creates a new TextParser object.

Creates a new TextParser object.

Parameters

$content
string $content The contents of the dbfield

Overrides

Object::__construct
public
# setContent( mixed $content = "" )

Convenience method, shouldn't really be used, but it's here if you want it

Convenience method, shouldn't really be used, but it's here if you want it

abstract public
# parse( )

Define your own parse method to parse $this->content appropriately. See the class doc-block for more implementation details.

Define your own parse method to parse $this->content appropriately. See the class doc-block for more implementation details.

Methods inherited from Object

__call(), __toString(), __wakeup(), addMethodsFrom(), addStaticVars(), addWrapperMethod(), add_extension(), add_static_var(), allMethodNames(), cacheToFile(), cacheToFileWithArgs(), clearCache(), combined_static(), create(), createMethod(), create_from_string(), defineMethods(), exists(), extInstance(), extend(), getCustomClass(), getExtensionInstance(), getExtensionInstances(), get_extensions(), get_static(), hasExtension(), hasMethod(), has_extension(), invokeWithExtensions(), is_a(), loadCache(), parentClass(), parse_class_spec(), remove_extension(), sanitiseCachename(), saveCache(), set_stat(), set_static(), set_uninherited(), stat(), strong_create(), uninherited(), uninherited_static(), useCustomClass()

Magic methods summary

Properties summary

protected mixed $content
#

Properties inherited from Object

$class, $extension_instances, $extensions

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -
Webylon 3.1 API Docs API documentation generated by ApiGen 2.8.0