6

Form example:

<?php include_partial('job/list', array('jobs' => $jobs)) ?>

I have module job and partial _list.php in module folder templates. Is it possible create in templates folder partials and in include all partials from that folder? If it possible how to make it? Thank you!

denys281
  • 2,004
  • 2
  • 19
  • 38

1 Answers1

13
  1. Create a '_partials' folder in the templates directory in your module
  2. Create a 'list.php' in the '_partials' folder, ie 'modules/job/templates/_partials/list.php'
  3. Call it as:

    <?php include_partial('job/partials/list', array('jobs' => $jobs))?>

Mikhail
  • 2,542
  • 4
  • 29
  • 40