Cant use $this->_forward() on zend - zend-framework

i am trying to use $this->_forward($action,$controller); at my view, but i am getting this error:
Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name '_forward' was not found in the registry; used paths: Zend_View_Helper_: Zend/View/Helper/;C:/Program Files (x86)/Zend/Apache2/htdocs/dentallab/application/modules/default/views\helpers/' in C:\Program Files (x86)\Zend\ZendServer\data\libraries\Zend_Framework_1\1.12.3\library\Zend\Loader\PluginLoader.php:412
Stack trace:
#0 C:\Program Files (x86)\Zend\ZendServer\data\libraries\Zend_Framework_1\1.12.3\library\Zend\View\Abstract.php(1182): Zend_Loader_PluginLoader->load('_forward')
#1 C:\Program Files (x86)\Zend\ZendServer\data\libraries\Zend_Framework_1\1.12.3\library\Zend\View\Abstract.php(618): Zend_View_Abstract->_getPlugin('helper', '_forward')
#2 C:\Program Files (x86)\Zend\ZendServer\data\libraries\Zend_Framework_1\1.12.3\library\Zend\View\Abstract.php(344): Zend_View_Abstract->getHelper('_forward')
#3 C:\Program Files (x86)\Zend\Apache2\htdocs\dentallab\application\modules\default\views\scripts\institucional\index.phtml in C:\Program Files (x86)\Zend\ZendServer\data\libraries\Zend_Framework_1\1.12.3\library\Zend\Controller\Plugin\Broker.php on line 336
if anyone can help me, i appreciate!

You can use Action View Helper for this situation
in the view,
<?php echo $this->action('action',
'controller',
'module',
array('param' => 10)); ?>
Here is the link to the ZF manual Action View Helper

Related

Zend - Fatal error: Uncaught Zend_View_Exception: script '/.phtml'

Get the following error message on my app. The app is written with the Zend framework, but not by myself. Can anyone tell me what the error message says.
It is about an extra module after all and a template file is missing. Is that correct so far? Can I just copy it in there myself?
Fatal error: Uncaught Zend_View_Exception: script '/.phtml' not found in path
(/application/modules/default/views/scripts/) in
/library/Zend/View/Abstract.php:987 Stack trace: #0
/library/Zend/View/Abstract.php(883): Zend_View_Abstract->_script('/.phtml')
#1 /library/Zend/Controller/Action/Helper/ViewRenderer.php(910):
Zend_View_Abstract->render('/.phtml') #2
library/Zend/Controller/Action/Helper/ViewRenderer.php(931):
Zend_Controller_Action_Helper_ViewRenderer->renderScript('/.phtml', NULL) #3
library/Zend/Controller/Action/Helper/ViewRenderer.php(970):
Zend_Controller_Action_Helper_ViewRenderer->render() #4
/libr in
library/Zend/Controller/Plugin/Broker.php on line 335
Would be very grateful for any tip.
Greetz Bavra

ZF - How to render a view with its controller?

I want to call another view from my view, but I need this new one to be processed with its controller, so I can have my SQL queries.
I am using $this->render('new-view.phtml') but this does not process the controller together, it returns only the view.
Anybody know how to do it? Thanks!
EDITED
Using $this->_forward(); i got this error:
Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'RenderScript' was not found in the registry; used paths: Zend_View_Helper_: Zend/View/Helper/;C:/Program Files (x86)/Zend/Apache2/htdocs/dentallab/application/modules/default/views\helpers/' in C:\Program Files (x86)\Zend\ZendServer\data\libraries\Zend_Framework_1\1.12.3\library\Zend\Loader\PluginLoader.php:412 Stack trace: #0 C:\Program Files (x86)\Zend\ZendServer\data\libraries\Zend_Framework_1\1.12.3\library\Zend\View\Abstract.php(1182): Zend_Loader_PluginLoader->load('RenderScript') #1 C:\Program Files (x86)\Zend\ZendServer\data\libraries\Zend_Framework_1\1.12.3\library\Zend\View\Abstract.php(618): Zend_View_Abstract->_getPlugin('helper', 'renderScript') #2 C:\Program Files (x86)\Zend\ZendServer\data\libraries\Zend_Framework_1\1.12.3\library\Zend\View\Abstract.php(344): Zend_View_Abstract->getHelper('renderScript') #3 C:\Program Files (x86)\Zend\Apache2\htdocs\dentallab\application\modules\default\views\scripts\instituci in C:\Program Files (x86)\Zend\ZendServer\data\libraries\Zend_Framework_1\1.12.3\library\Zend\Controller\Plugin\Broker.php on line 336
You can use
$this->_forward($action, $controller);
as thom suggested if you want to use you controller and view script from another view script .

Zend Session saves in the right path, but gc try to clean elsewhere

My Project is running under ZF 1.11, and it throws this error randomly:
Fatal error: Uncaught exception 'Zend_Session_Exception' with message 'Zend_Session::start() - /home/user/www/MyProject/library/Zend/Session.php(Line:469): Error #8 session_start() [<a href='function.session-start'>function.session-start</a>]: ps_files_cleanup_dir: opendir(/tmp) failed: Permission denied (13) Array' in /home/user/www/MyProject/library/Zend/Session.php:482 Stack trace:
#0 /home/user/www/MyProject/library/Zend/Session/Namespace.php(143): Zend_Session::start(true)
#1 /home/user/www/MyProject/library/Dlx/Acl/Permissao.php(8): Zend_Session_Namespace->__construct('user_info')
#2 /home/user/www/MyProject/application/Bootstrap.php(72): Dlx_Acl_Permissao->__construct(Object(Zend_Db_Adapter_Pdo_Mysql))
#3 /home/user/www/MyProject/library/Zend/Application/Bootstrap/BootstrapAbstract.php(669): Bootstrap->_initLoaders()
#4 /home/user/www/MyProject/library/Zend/Application/Bootstrap/BootstrapAbstract.php(622): Zend_Application_Bootstrap_BootstrapAbstract->_executeResource('loaders')
#5 /home/user/ in /home/user/www/MyProject/library/Zend/Session.php on line 482
As you can see, it tries to clean the session in /tmp directory, but in my application.ini the configuration sets session.save_path to APPLICATION_PATH "/../data/session" (ZF default conf), and it saves the session in this path, but when gc runs, it tries to clean in the wrong directory
This is my application.ini session configuration:
http://codepad.org/mJUyipG0
Btw, /data and /data/session permission are set to 777
Any ideas ?
Check your php.ini /tmp seems top be the default directory for php session saves. Although in my installation the save path line is commented out. ;session.save_path = "/tmp"
You can also debug by dumping Zend_Session::getOptions(); (it is a static method) to make sure your parameters are being correctly set.
This might be the cause of the exception:
string save_path - The correct value is system dependent, and should
be provided by the developer using an absolute path to a directory
readable and writable by the PHP process. If a writable path is not
supplied, then Zend_Session will throw an exception when started
(i.e., when start() is called).
Hopefully it's this simple, just supply an absolute path and check permissions.
The .. in the path may be the problem. APPLICATION_PATH "/../data/session"

Zend Framework Disapatcher error so suddnly

is about a week I work for an application and now, yesterday i receive this error and than so suddnly has disappeared and I continued to work! now i receive again this error but without any change!
how can i solve it?
thanks
Warning: include_once(/www/zendsvr/htdocs/TassiWeb/application/controllers/LoginController.php) [function.include-once]: failed to open stream: Too many open files in /usr/local/zendsvr/share/ZendFramework/library/Zend/Controller/Dispatcher/Standard.php on line 344
Warning: include_once() [function.include]: Failed opening '/www/zendsvr/htdocs/TassiWeb/application/controllers/LoginController.php' for inclusion (include_path='/www/zendsvr/htdocs/TassiWeb/application/../library:/www/zendsvr/htdocs/TassiWeb/library:.:/usr/local/zendsvr/share/ZendFramework/library:/usr/local/zendsvr/share/pear') in /usr/local/zendsvr/share/ZendFramework/library/Zend/Controller/Dispatcher/Standard.php on line 344
Warning: include_once(/www/zendsvr/htdocs/TassiWeb/application/controllers/ErrorController.php) [function.include-once]: failed to open stream: Too many open files in /usr/local/zendsvr/share/ZendFramework/library/Zend/Controller/Dispatcher/Standard.php on line 344
Warning: include_once() [function.include]: Failed opening '/www/zendsvr/htdocs/TassiWeb/application/controllers/ErrorController.php' for inclusion (include_path='/www/zendsvr/htdocs/TassiWeb/application/../library:/www/zendsvr/htdocs/TassiWeb/library:.:/usr/local/zendsvr/share/ZendFramework/library:/usr/local/zendsvr/share/pear') in /usr/local/zendsvr/share/ZendFramework/library/Zend/Controller/Dispatcher/Standard.php on line 344
Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller class ("ErrorController")' in /usr/local/zendsvr/share/ZendFramework/library/Zend/Controller/Dispatcher/Standard.php:352
Stack trace:
/usr/local/zendsvr/share/ZendFramework/library/Zend/Controller/Dispatcher/Standard.php(262): Zend_Controller_Dispatcher_Standard->loadClass('ErrorController')
/usr/local/zendsvr/share/ZendFramework/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
/usr/local/zendsvr/share/ZendFramework/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
/usr/local/zendsvr/share/ZendFramework/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
/www/zendsvr/htdocs/TassiWeb/public/index.php(26): Zend_Application->run()
{main}
thrown in /usr/local/zendsvr/share/ZendFramework/library/Zend/Controller/Dispatcher/Standard.php on line 352
Zend needs a lot of files open. But the 'too many open files' issue is connected with recursion; particularly a loop of files where A includes B includes C includes A (for instance.)
With Zend you shouldn't need to manually include files for the most part, since it uses auto-loading. In that week's time I'm thinking you may have introduced an accidental recursion.
Remove that recursion (or make sure the includes are include_once/require_once) and you will address the issue.
I had a similar 'too many files' open error and it ended up being that I was extending the wrong Bootstrap class in my module. I was using Zend_Application_Bootstrap_Bootstrap instead of Zend_Application_Module_Bootstrap. So check if you have more than one implementation of Zend_Application_Bootstrap_Bootstrap. Hope that applies to your situation.

Always get this error when I use upload images - Using Zend Framework

Warning: include_once(Zend/Http/Client.php) [function.include-once]: failed to open stream: No such file or directory in /home/hotbuzz/public_html/include/Zend/Loader.php on line 83
Warning: include_once() [function.include]: Failed opening 'Zend/Http/Client.php' for inclusion (include_path='/home/hotbuzz/public_html/include;.:/usr/lib/php:/usr/local/lib/php') in /home/hotbuzz/public_html/include/Zend/Loader.php on line 83
Warning: require_once(Zend/Exception.php) [function.require-once]: failed to open stream: No such file or directory in /home/hotbuzz/public_html/include/Zend/Loader.php on line 87
Fatal error: require_once() [function.require]: Failed opening required 'Zend/Exception.php' (include_path='/home/hotbuzz/public_html/include;.:/usr/lib/php:/usr/local/lib/php') in /home/hotbuzz/public_html/include/Zend/Loader.php on line 87
Always get this error when i use image upload in the script .. I m using Zend Framework .. I i dont know what to do ?
My Zend path : public_html/include/zend
phpinfo : hotbuzz.in/phpinfo.php
I have not configured path to Zend in .htaccess
?
try this
set_include_path(dirname(realpath(__FILE__)).PATH_SEPARATOR.get_include_path());
Does your include path point to the library files or just the root of the Zend project. The include path needs to point to the directory that contains the directory structure
Zend
Acl
Auth
etc...
which maybe the library directory of the files you downloaded.
There is something weird in your include path ;.:
I think you probably have use the syntax of windows in a linux server.
You should use PATH_SEPARATOR the be sure that you will have the right one on every server.