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

  • Announcement_Controller
  • AnnouncementHolder_Controller
  • BookingAdminPage_Controller
  • BookingPage_Controller
  • Cart_Controller
  • CartPage_Controller
  • Catalog_Controller
  • CheckoutPage_Controller
  • ChequePayment_Handler
  • ContactsPage_Controller
  • ContentController
  • ContentNegotiator
  • Controller
  • DataObjectManager_Controller
  • DatePickerField_Controller
  • Director
  • DocPage_Controller
  • DocumentsPage_Controller
  • Event_Controller
  • EventHolder_Controller
  • FileDataObjectManager_Controller
  • FindCyrillic_Controller
  • HomePage_Controller
  • LastDoc_Controller
  • LiveCalendarWidget_Controller
  • MapObject_Controller
  • MapObjectGroup_Controller
  • MapPage_Controller
  • MediawebPage_Controller
  • ModelAsController
  • MultiUploadControls
  • NewsArchive
  • Orders1CExchange_Controller
  • Page_Controller
  • Payment_Handler
  • PhotoAlbumManager_Controller
  • Product_Controller
  • ProductSearchPage_Controller
  • ProfilePage_Controller
  • PublHolder_Controller
  • Publication_Controller
  • RatingExtension_Controller
  • RegistrationPage_Controller
  • RemoveOrphanedPagesTask
  • RequestHandler
  • Room_Controller
  • RoomCatalog_Controller
  • RootURLController
  • SapphireInfo
  • Search_Controller
  • Session
  • SimpleOrderPage_Controller
  • SiteMap_Controller
  • SpecialCatalog_Controller
  • SS_HTTPRequest
  • SS_HTTPResponse
  • StartCatalog_Controller
  • SubsitesSelectorPage_Controller
  • VideoBankPage_Controller

Interfaces

  • NestedController

Exceptions

  • SS_HTTPResponse_Exception

Class ContentNegotiator

The content negotiator performs "text/html" or "application/xhtml+xml" switching. It does this through the static function ContentNegotiator::process(). By default, ContentNegotiator will comply to the Accept headers the clients sends along with the HTTP request, which is most likely "application/xhtml+xml" (see "Order of selection" below).

Order of selection between html or xhtml is as follows:

  • if PHP has already sent the HTTP headers, default to "html" (we can't send HTTP Content-Type headers any longer)
  • if a GET variable ?forceFormat is set, it takes precedence (for testing purposes)
  • if the user agent is detected as W3C Validator we always deliver "xhtml"
  • if an HTTP Accept header is sent from the client, we respect its order (this is the most common case)
  • if none of the above matches, fallback is "html"

ContentNegotiator doesn't enable you to send content as a true XML document through the "text/xml" or "application/xhtml+xml" Content-Type. Please see http://webkit.org/blog/68/understanding-html-xml-and-xhtml/ for further information.

Package: sapphire\control
See: http://doc.silverstripe.org/doku.php?id=xhtml-support
See: http://doc.silverstripe.org/doku.php?id=contentnegotiator
See: http://doc.silverstripe.org/doku.php?id=html
Located at sapphire/core/control/ContentNegotiator.php

Methods summary

public static
# set_encoding( mixed $encoding )

Set the character set encoding for this page. By default it's utf-8, but you could change it to, say, windows-1252, to improve interoperability with extended characters being imported from windows excel.

Set the character set encoding for this page. By default it's utf-8, but you could change it to, say, windows-1252, to improve interoperability with extended characters being imported from windows excel.

public static
# get_encoding( )

Return the character encoding set bhy ContentNegotiator::set_encoding(). It's recommended that all classes that need to specify the character set make use of this function.

Return the character encoding set bhy ContentNegotiator::set_encoding(). It's recommended that all classes that need to specify the character set make use of this function.

public static
# enable( )

Enable content negotiation for all templates, not just those with the xml header.

Enable content negotiation for all templates, not just those with the xml header.

public static
# disable( )
public static
# enabled_for( mixed $response )

Returns true if negotation is enabled for the given response. By default, negotiation is only enabled for pages that have the xml header.

Returns true if negotation is enabled for the given response. By default, negotiation is only enabled for pages that have the xml header.

public static
# process( SS_HTTPResponse $response )
public string
# xhtml( SS_HTTPResponse $response )

Only sends the HTTP Content-Type as "application/xhtml+xml" if the template starts with the typical "<?xml" Pragma. Assumes that a correct doctype is set, and doesn't change or append to it. Replaces a few common tags and entities with their XHTML representations (
, <img>,  ).

Only sends the HTTP Content-Type as "application/xhtml+xml" if the template starts with the typical "<?xml" Pragma. Assumes that a correct doctype is set, and doesn't change or append to it. Replaces a few common tags and entities with their XHTML representations (
, <img>,  ).

Parameters

$response
$response SS_HTTPResponse

Returns

string
string
public
# html( SS_HTTPResponse $response )

Magic methods summary

Properties summary

protected static string $encoding
#
protected static boolean $enabled
#
[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