0

I've read over this article about placeholders. Previously, i was including a bunch of files into my view scripts. after time that become complicated as i had to account for context and there isn't a really good solution.

I'm guessing this is where placeholders come in. I've read over the zend article. None of the articles i've read are very specific as to where i place my placeholders. in what folder should they go in?

Forgive me i'm still very confused with zend.

chrisjlee
  • 21,691
  • 27
  • 82
  • 112
  • Take a look at my answer here http://stackoverflow.com/a/9264520/212940 and see if it helps. I linked it as the article you link to is about view helpers, not placeholders. – vascowhite Apr 11 '12 at 05:43

1 Answers1

1

Basically your will capture a block somewhere in controller/view then you'll display it in the template/layout.

I think this Zend Doc example makes more sense.

// before the view is displayed
// you can use other methods to render the templates into placeholder for later use
<?php $this->placeholder('foo')->set("Some text for later") ?>

// most like somewhere in the view
<?php
    echo $this->placeholder('foo');
    // outputs "Some text for later"
?>
or 
<?= $this->placeholder('sidebar') ?>
Alex
  • 6,441
  • 2
  • 25
  • 26