Previous Page
newHelper()

Solar_View
partial()

Next Page
setHelperClass()

partial()

public string partial ( string $name, array|object $spec default NULL )

Executes a partial template in its own scope, optionally with variables into its within its scope.

Parameters

  • (string) $name: The partial template to process.
  • (array|object) $spec: Additional variables to use within the partial template scope. If an array, we use extract() on it. If an object, we create a new variable named after the partial template file and set that new variable to be the object. E.g., passing an object to a partial template named _foo-bar.php will use that object as $foo_bar in the partial.

Returns

  • (string) The results of the partial template script.

Description

Executes a partial template in its own scope, optionally with variables into its within its scope.

Note that when you don't need scope separation, using a call to "include $this->template($name)" is faster.