\LivePubControllerHooks
Extension for Controller class to give you some hooks for livepub in the template.
- Author: Mark Guinn <mark@adaircreative.com>
Synopsis
class LivePubControllerHooks
extends Extension
{
- // methods
- public string BaseTag()
- public void IncludePHP()
- public void WrappedSession()
- public void LPH_Session()
- public void WrappedRequest()
- public void LPH_Request()
- public void LPH_IsPublishing()
- public void LPH_NotPublishing()
- public void LPH_If()
- public void LPH_IfAjax()
- public void LPH_IfNotAjax()
- public void LPH_Else()
- public void LPH_EndIf()
Hierarchy
Extends
- Extension
Methods
public
- BaseTag() — The default base_tag implementation returns the full http:// url which causes issues with static publishing + https.
- IncludePHP() — allows you to include php templates that work even when static publishing is enabled
- LPH_Else() — output generic php closing the above functions
- LPH_EndIf()
- LPH_If() — if we're publishing, outputs an if statement $func should be something on the controller that is livepub sensitive (either uses eval_php or some other method to return code)
- LPH_IfAjax() — is this an ajax request? NOTE: this will not actually function as an IF statement in a live silverstripe template. You have to wrap them together like this for it to work in both live and published modes: <% if LPH_NotPublishing && isAjax %><% else %>$LPH_IfNotAjax $LPH_EndIf<% end_if %>
- LPH_IfNotAjax()
- LPH_IsPublishing() — are we currently publishing?
- LPH_NotPublishing()
- LPH_Request()
- LPH_Session()
- WrappedRequest() — returns a viewable wrapper around the request
- WrappedSession() — returns a viewable wrapper around the session