In init method of my controller I have

public function init() {
                $this->_helper->ajaxContext
                        ->setActionContext('facebook', 'html')
                        ->setActionContext('twitter', 'html')
                        ->initContext();
        }

This loads facebook and twitter widgets via ajax. They are in
facebook.ajax.phtml and twitter.ajax.phtml and this works ok. But, very
often I see in my error logs 

2010-03-23T00:15:00+01:00 ERR (3): exception 'Zend_View_Exception' with
message 'script 'index/facebook.phtml' not found in path
(application/modules/default/views/scripts/)' in Zend/View/Abstract.php:976
Stack trace:
#0 Zend/View/Abstract.php(876):
Zend_View_Abstract->_script('index/facebook....')
#1 Zend/Controller/Action/Helper/ViewRenderer.php(897):
Zend_View_Abstract->render('index/facebook....')
#2 Zend/Controller/Action/Helper/ViewRenderer.php(918):
Zend_Controller_Action_Helper_ViewRenderer->renderScript('index/facebook....',
NULL)
#3 Zend/Controller/Action/Helper/ViewRenderer.php(957):
Zend_Controller_Action_Helper_ViewRenderer->render()
#4 Zend/Controller/Action/HelperBroker.php(277):
Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#5 Zend/Controller/Action.php(523):
Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#6 Zend/Controller/Dispatcher/Standard.php(289):
Zend_Controller_Action->dispatch('facebookAction')
#7 Zend/Controller/Front.php(954):
Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http),
Object(Zend_Controller_Response_Http))
#8 Zend/Application/Bootstrap/Bootstrap.php(97):
Zend_Controller_Front->dispatch()
#9 Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#10 public_html/index.php(24): Zend_Application->run()
#11 {main}

I assume that for some reason (may be disabled javascript or direct url
visit) request goes not from ajax, but full page request without ajax
headers and /format/html.

How can I fix to show just widget content, and skipp this error?
-- 
View this message in context: 
http://n4.nabble.com/Help-with-ajaxContext-helper-tp1679001p1679001.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to