Those who use partials heavily and who profile their applications
will often immediately notice that the
helper incurs a lot of overhead, due to the need to clone the view
object. Is it possible to speed this up?
partial() view helper accepts three arguments:
$name: the name of the view script to render
$module: the name of the module in which the view script resides; or, if no third argument is provided and this is an array or object, it will be the
$model: an array or object to pass to the partial representing the clean data to assign to the view.
The power and use of
partial() come from the second
and third arguments. The
$module argument allows
partial() to temporarily add a script path for the
given module so that the partial view script will resolve to
that module; the
$model argument allows you to
explicitly pass variables for use with the partial view.
If you're not passing either argument, use
Basically, unless you are actually passing variables to the
partial and need the clean variable scope, or rendering a view
script from another MVC module, there is no reason to incur the
partial(); instead, use
method to render the view script.