clone
The clone function allows you to clone an object. It's typically used to clone HTML objects like an image object.
While this function is intended for objects, if you pass something other than an object then that value is simply returned. You don't need to use this function to make a copy of strings, numbers, or arrays. Just assign them to a new variable to create a copy of them.
This function is unique to Aptuitiv. It is not part of the core Twig functionality.
{% set newImage = clone(someImageObject) %}
Arguments
The clone function has the following signature.
clone(object)
Argument | Description |
---|---|
object | The object that you want to create a clone of. |