Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony include partial from custom folder

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!

like image 532
denys281 Avatar asked Feb 21 '12 11:02

denys281


1 Answers

  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))?>

like image 134
Mikhail Avatar answered Sep 30 '22 12:09

Mikhail