Including elements in Concrete CMS 5.7+

Was this information useful?
Thank you for your feedback.

We used to call Loader::element($element[, $arguments[, $packageHandle]]) or Loader::packageElement($element[, $packageHandle[, $arguments]) to include an element.

With Concrete CMS 5.7 and later versions, this should be written as:

// Include a core element without arguments
View::element($element);

// Include a core element with arguments
View::element($element, ['argument1' => 'value1', 'argument2' => 'value2']);

// Include a package element without arguments
View::element($element, null, $packageHandle);

// Include a package element with arguments
View::element($element, ['argument1' => 'value1', 'argument2' => 'value2'], $packageHandle);