Here’s a quick rundown of all the Comb functions (so far), in alphabetical order:

comb_add_header(string $name, string $value)
comb_add_template(string $file, string $name = '__content')
comb_buffer(string $name = '__content')
comb_get(string $name)
comb_halt()
comb_ini_get(string $name)
comb_ini_set(string $name, mixed $value)
comb_init(array $options)
comb_run()
comb_redirect(string $url)
comb_render()
comb_send()
comb_set(string $name, mixed $value)

comb_add_header(string $name, string $value)

  • Add an arbitrary response header to the internal headers array
  • Internal headers are all sent when comb_send() is called

comb_add_template(string $file, string $name = '__content')

  • Adds a PHP template to the internal user template queue
  • The optional $name parameter indicates a unique buffer name, into which the template’s rendered result will be stored for use by subsequent templates.
  • User-specified templates are rendered FIFO, so if T1 and T2 are added in that order, T2 will be able to plug in T1’s rendered result by specifying its buffer name (2nd parameter).

comb_buffer(string $name = '__content')

  • Fetch the rendered contents of the named buffer.

comb_get(string $name)

  • Get the named variable that was assigned to the internal registry via comb_set().

comb_halt()

  • Tell the run loop to not process anymore scripts in the execution chain.
  • NOTE: rendering will still take place. If you don’t want that, be sure to also disable rendering when you call comb_halt().

comb_ini_get(string $name)

  • Get the specified INI setting’s value.

comb_ini_set(string $name, mixed $value)

  • Set the specified INI value.

comb_init(array $options)

  • Initialize Comb’s internal settings with the specified options.
  • INI values (will) have the following precedence: default, php.ini, httpd.conf, .htaccess, PHP array.

comb_run()

  • Parse the requested script’s path to build the execution chain.
  • “Run” the execution chain, i.e., include each file.
  • Return immediately upon encountering a call to comb_halt().
  • Call the request method function if it exists, e.g., get(), post(), xhr().

comb_redirect(string $url)

  • Send a 302 redirect back to the client (actually sent via comb_send())
  • Functionally equivalent to calling comb_halt(), com_add_header(), and disabling rendering.

comb_render()

  • Build the system template queue, if template auto-detection is enabled.
  • Prepend the user template queue to the system queue.
  • Extract the variables stored in the internal registry.
  • Render each template in the queue.

comb_send()

  • If buffering is enabled, send any stored headers (from comb_add_header()) and echo the contents primary buffer, ‘__content’

comb_set(string $name, mixed $value)

  • Set an internal registry entry named $name to $value