Rename parameter to $isLast from 'control' to 'template' to more clearly represent the scenario in which it is used. Also add example usage in comment block.