views:

46

answers:

1

Hi,

I have a search module. It has one form within it that produces the search field, I am using a viewScript that is stored within views/scripts/forms to render the form.

I want this form to appear on ever screen so I have written a ViewHelper that creates the from and returns it. This works fine when I am within the search module but when I am in any other module I am getting an error.

Any ideas why?

This is what is used to create the viewScript in the form

$this->setDecorators(array(
    array( 'ViewScript', array('viewScript' => 'forms/Search.phtml'))
));

Thanks, Martin

A: 

In my code I have to put a / in front of the path so for you it would mean:

$this->setDecorators(array(
    array( 'ViewScript', array('viewScript' => '/forms/Search.phtml'))
));
Iznogood
Hi Iznogood, thanks for the response, still getting the same error I'm afraid.
Martin
Just noticed you say search module. Is it a real module or do you just call views modules.
Iznogood
It's a real module.
Martin
So you are trying to call a viewscript from another module? Is it possible you need to ajust the path of the viewscript when you try ton invokle it from another module?
Iznogood