Ralph Schindler wrote:
>
> I have added a jira issue for this as it seems to be coming up quite a
> bit, I think the solution is that this exception message could be more
> descriptive of where its looking for this script. Ie:
>
> script
> > 'index/index.phtml' not found in path (./path/1:./path/2)
>
> Jira issue:
> http://framework.zend.com/issues/browse/ZF-1481
>
> -ralph
>
> Cyber wrote:
>> I've just switch from ZF 0.9 to 1.0RC1 and have problems with pathes to
>> view
>> scripts.
>> At this moment i've got directory structure like above
>>
>> ./
>> /application
>> ./admin
>> ./controllers
>> ./model
>> ./view
>> ./index <- index controller for module admin
>> index.php <- and index action
>>
>> I've wrote plugin to call setScriptPath and add it to view object but
>> when
>> i'm calling method it says:
>>
>>
>> Fatal error: Uncaught exception 'Zend_View_Exception' with message
>> 'script
>> 'index/index.phtml' not found in path' in
>> E:\Localhost\DVDCollector\library\Zend\View\Abstract.php:853 Stack trace:
>> #0
>> E:\Localhost\DVDCollector\library\Zend\View\Abstract.php(764):
>> Zend_View_Abstract->_script('index/index.pht...') #1
>> E:\Localhost\DVDCollector\library\Zend\Controller\Action\Helper\ViewRenderer.php(702):
>> Zend_View_Abstract->render('index/index.pht...') #2
>> E:\Localhost\DVDCollector\library\Zend\Controller\Action\Helper\ViewRenderer.php(723):
>> Zend_Controller_Action_Helper_ViewRenderer->renderScript('index/index.pht...',
>> NULL) #3
>> E:\Localhost\DVDCollector\library\Zend\Controller\Action\Helper\ViewRenderer.php(770):
>> Zend_Controller_Action_Helper_ViewRenderer->render() #4
>> E:\Localhost\DVDCollector\library\Zend\Controller\Action\HelperBroker.php(160):
>> Zend_Controller_Action_Helper_ViewRenderer->postDispatch() #5
>> E:\Localhost\DVDCollector\library\Zend\Controller\Action.php(504):
>> Zend_Controller_Action_HelperBroker->notifyPostDispatch() #6 in
>> E:\Localhost\DVDCollector\library\Zend\View\Abstract.php on line 853
>>
>>
>> Of course i've changed view scripts extensions to phtml but it doesn't
>> work
>> :/
>
>
>
Dear Ralph,
While the use of the conventional modular directory structure is suggested
in the manual, "7.1.2.1. Create your filesystem layout", it is not *spelled
out* where the ViewRenderer helper is discussed at "7.8.4.3. ViewRenderer".
I think that something like the following could be inserted in this section
to show the whole and simple picture under "7.8.4.3. ViewRenderer". I think
I have got it correct. However, adjust as necessary. The layout was done
with a word.doc file and does not come across too well in the email format.
CONVENTIONAL MODULAR DIRECTORY STRUCTURE for use with ViewRenderer
The optional folders are marked (of course modules are all optional
anyway):
application/
modules/
default/ (optional)
controllers/
IndexController.php
models/ (optional)
views/
scripts/
index/
index.phtml
helpers/ (optional)
filters/ (optional)
( THE NEXT MODULES ARE ALL OPTIONAL BUT CAN BE ADDED AD
INFINITUM )
modulename1/
controllers/
ControllernameController.php
Controllername2Controller.php
........
models/ (optional)
views/
scripts/
Controllername/
actionname.phtml
actionname2.phtml
.....
helpers/ (optional)
filters/ (optional)
modulename2/ (optional)
controllers/
ControllernameController.php
Controllername2Controller.php
......
models/ (optional)
views/ (optional)
scripts/
Controllername/
actionname.phtml
......
helpers/(optional)
filters/(optional)
modulename3/ (optional)
controllers/
ControllernameController.php
......
models/ (optional)
views/
scripts/
Controllername/
actionname.phtml
......
helpers/ (optional)
filters/ (optional)
html/
.htaccess
index.php
To make all this work all one needs to do is add the following line to the
bootstrap(index.php):
$front->addModuleDirectory('application/modules');
Allan Vernon
--
View this message in context:
http://www.nabble.com/Problem-with-path-in-Zend_View-tf3856701s16154.html#a10933061
Sent from the Zend Framework mailing list archive at Nabble.com.