This section illustrates implementations an usage of HTML meta elements and Client Side Scripting components.
HTML metadata
The <head> is implemented by the Head class. The
<head> contains information such as the page <title>,
links to external resources, and other metadata (data that describes the document).
The following list describe HTML meta data components:
All content of the Head component implement atleast Metadata interface.
Base - implements HTML <base> tag. It specifies
the base URL to use for all relative URLs in a document. There can be only one
<base> element in a document.
Meta data can be described also in a PHP array or an YAML file.
SPHPlayground is capable to transform this data to an HTML head component,
PHP version
YAML version
JSON version
NEON version
The Open Graph protocol
The Open Graph protocol enables any web page to become a rich object in
a social graph. For instance, this is used on Facebook to allow any web
page to have the same functionality as any other object on Facebook.
PHP version
YAML version
JSON version
NEON version
Client-side scripting using JavaScript containers
Client-Side JavaScript is JavaScript code that runs directly in a user’s web
browser rather than on a server. It’s what makes web pages interactive, dynamic,
and responsive to user actions.
Script interface defines an HTML element for client-side scripting, usually JavaScript.
InlineScript class implements an HTML element that contains client-side scripting statements
ExternalScript class implements an HTML element that points to an external script file
Noscript class implements an HTML element for situations where there is no support for client-side scripting
NOTE!:
The best practice of placing client side scripts is usually the end of the page, just inside the closing body tag.
This guarantees that all of the DOM elements needed are already present on the page.
user.js - file
FooBarUser.js - file
Foo User View:
This site uses cookies
In order to work as intended, this site stores cookies on your device. Accepting
improves our site and provides you with personalized service. Declining results
in one cookie being placed on your device so we remember your choice.