SproutCMS

This is the code documentation for the SproutCMS project

function contentReplace()

Register a method for a content replacement chain

Registered method will receive one string argument and should return a string.
For the 'inner_html' chain, the input and output should be HTML

Common chains:
     inner_html      The "inside" HTML of widgets (richtext, blog content, etc)
     main_content    The main content of inner and wide templates

Usage

void Register::contentReplace ( string $chain , string $func );

Example

// register method
Register::contentReplace('inner_html', ['Sprout\\Helpers\\ContentReplace', 'intlinks']);
 
// execute chain
$new_html = ContentReplace::executeChain('inner_html', $old_html);

Arguments

  1. string $chain
    The chain to register the method for, e.g. 'inner_html'
  2. string $func
    callable $func The method to register

Return value

  • void