Hi, 

I try to use elements of templates to build the requested side. I
started with http://trac.agavi.org/trac.cgi/wiki/UsingDecorators and
it worked well. But i dont get it to work to use more the one Slot in
a Template.

The first Slot works well (HeadMenu), but with the second (eTest) I 
just get this error: 

Notice: Undefined index: eTest in
/usr/local/workspace/projects/arabazar/webapp/modules/Default/templates/IndexSuccess.php
on line 3

Heres my structur (files and code): 
[file:] webapp/modules/Default/views/IndexSuccessView.class.php:
    public function execute ()
    {

        // set our template
        $this->setDecoratorTemplate('Master.php');

        $this->setSlot('HeadMenu', 'Default', 'HeadMenu');
        $this->setSlot('eTest', 'Default', 'eTest');

        $this->setTemplate('IndexSuccess.php');

        $this->setAttribute('text',
$this->getContext()->getRequest()->getAttribute('text'));
        $this->setAttribute('title',
$this->getContext()->getRequest()->getAttribute('title'));
    }

[file:] webapp/modules/Default/templates/IndexSuccess.php
<p><?=$template['text']?></p>
<hr/>
<p><?=$template['eTest']?></p>

[file:] webapp/modules/Default/actions/eTestAction.class.php
    public function getDefaultView ()
    {
    
        $this->getContext()->getRequest()->setAttribute('sTest', "Test
string for inclusion");
        return View::SUCCESS;
        
    } 

[file:] webapp/modules/Default/views/eTestSuccessView.class.php
    public function execute ()
    {
    
        // set our template
        $this->setTemplate('eTestSuccess.php');
        
        // set the title
        $this->setAttribute('sTest',
$this->getContext()->getRequest()->getAttribute('sTest'));
    
    }

[file:] webapp/modules/Default/templates/eTestSuccess.php
<h1>
<?=$template['sTest'] ?>
</h1> 

[file:] webapp/modules/Default/templates/Master.php
<html>
  <head>
    <title>Page &middot; <?=$template['title']?></title>
    <style type="text/css">
        @import url(media/Default.css) Screen;
    </style>
  </head>
  <body>
    <?=$template['HeadMenu']?>
    <hr />
    <?=$template['content']?>
  </body>
</html>


I don't know who i should manage it to get a template in a template?

Regards Erik

-- 
J. Erik Heinz
Keyboard-samuraing in process
_______________________________________________
agavi-dev mailing list
[email protected]
http://labworkz.com/cgi-bin/mailman/listinfo/agavi-dev

Reply via email to