2009年10月4日星期日

Re: [fw-mvc] Plugin by name 'Dojo' was not found in the registry when there is *no* Dojo elements in view !

-- Bourth <g.briard@cg33.fr> wrote
(on Friday, 02 October 2009, 01:04 AM -0700):
> I solved this error.
>
> In bootstrap.php
>
> I replace :
>
> $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
>
> By :
>
> $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper(
> 'ViewRenderer'
> );
>
> Could you explain me why it works now ???

The first instantiates the view renderer, but does not attach it to the
helper broker. The second grabs if from the helper broker, optionally
instantiating it if it does not exist.

--
Matthew Weier O'Phinney
Project Lead | matthew@zend.com
Zend Framework | http://framework.zend.com/

[fw-db] Fatal error: Uncaught exception 'Zend_Db_Exception' with message 'Adapter name must be specified in a string'

Fatal error: Uncaught exception 'Zend_Db_Exception' with message 'Adapter name must be specified in a string'

I've been googling this problem but can't find any hints to follow.  Can somebody help me fix this Error?
The code that is causing this error is this:


Bootstrap

    protected function _initRegDatabase()
    {
    $config = Zend_Registry::get('config');
       
        $db = Zend_Db::factory($config->db);                            //   This line seems to cause the Error!
        Zend_Db_Table_Abstract::setDefaultAdapter($db);
        Zend_Registry::set('db', $db);
    }


/apprentice

2009年10月3日星期六

[fw-db] Zend_Db_Select from() & join() fixes

Hey all,

I have updated Zend_Db_Select to fix a problem several people might have
experienced in one form or another (specifically when trying to use
Zend_Auth_Adapter_DbTable::getDbSelect() to join against).

The issue is here:
http://framework.zend.com/issues/browse/ZF-6653

And the fix is in trunk as of r18475.

This fix passes all previous unit tests. While I cannot conceive of a
use case that it would break (stright up or by extending
Zend_Db_Select), and also since the fix is so extensive, I'd like to
make sure no one has issues with it before merging in the 1.9 branch.

Thanks in advance!
-ralph

Re: [fw-mvc] Problem with a simple route

Just an addendum:

According to this line:

#5 C:\wamp\www\hunnyhive\application\modules\default\views\scripts\view\profile.phtml(17): Zend_View->url(Array, NULL, true)

It would seem that there is a problem in the profile.phtml view script but this is the code that is on that line:

            <a href="<?php  echo $this->url(array('module' => 'default',                       'controller' => 'my-account',                       'action' => 'write-message'),                 null,                 true);              ?>" class="blue" id="send-message">Send Message</a>


So that error message makes no sense.

View this message in context: Re: Problem with a simple route
Sent from the Zend MVC mailing list archive at Nabble.com.

[fw-mvc] Problem with a simple route

Hello everyone,

On few following lines I will try to explain my problem as clearly as I can. What I am trying to do is match URLs like this:

www.mydomain.com/someusername

To this:

www.mydomain.com/view/profile/username/someusername

To achieve this I have added this code to my bootstrap file:

    protected function _initRoutes()     {         $this->router = $this->frontController->getRouter();         $route = new Zend_Controller_Router_Route(             ':username',             array(                 'module'       => 'default',                 'controller'   => 'view',                 'action'       => 'profile'             )         );         $this->router->addRoute('profile', $route);     }


Now my problems:

1) When I go to www.mydomain.com/someusername I get this error message:

Message: username is not specified  Stack trace  #0 C:\wamp\www\hunnyhive\library\Zend\Controller\Router\Rewrite.php(441): Zend_Controller_Router_Route->assemble(Array, true, true)  #1 C:\wamp\www\hunnyhive\library\Zend\View\Helper\Url.php(49): Zend_Controller_Router_Rewrite->assemble(Array, NULL, true, true)  #2 [internal function]: Zend_View_Helper_Url->url(Array, NULL, true)  #3 C:\wamp\www\hunnyhive\library\Zend\View\Abstract.php(342): call_user_func_array(Array, Array)  #4 [internal function]: Zend_View_Abstract->__call('url', Array)  #5 C:\wamp\www\hunnyhive\application\modules\default\views\scripts\view\profile.phtml(17): Zend_View->url(Array, NULL, true)  #6 C:\wamp\www\hunnyhive\library\Zend\View.php(108): include('C:\wamp\www\hun...')  #7 C:\wamp\www\hunnyhive\library\Zend\View\Abstract.php(833): Zend_View->_run('C:\wamp\www\hun...')  #8 C:\wamp\www\hunnyhive\library\Zend\Controller\Action\Helper\ViewRenderer.php(903): Zend_View_Abstract->render('view/profile.ph...')  #9 C:\wamp\www\hunnyhive\library\Zend\Controller\Action\Helper\ViewRenderer.php(924): Zend_Controller_Action_Helper_ViewRenderer->renderScript('view/profile.ph...', NULL)  #10 C:\wamp\www\hunnyhive\library\Zend\Controller\Action\Helper\ViewRenderer.php(963): Zend_Controller_Action_Helper_ViewRenderer->render()  #11 C:\wamp\www\hunnyhive\library\Zend\Controller\Action\HelperBroker.php(277): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()  #12 C:\wamp\www\hunnyhive\library\Zend\Controller\Action.php(523): Zend_Controller_Action_HelperBroker->notifyPostDispatch()  #13 C:\wamp\www\hunnyhive\library\Zend\Controller\Dispatcher\Standard.php(289): Zend_Controller_Action->dispatch('profileAction')  #14 C:\wamp\www\hunnyhive\library\Zend\Controller\Front.php(946): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))  #15 C:\wamp\www\hunnyhive\application\Bootstrap.php(100): Zend_Controller_Front->dispatch()  #16 C:\wamp\www\hunnyhive\library\Zend\Application.php(335): Bootstrap->run()  #17 C:\wamp\www\hunnyhive\public\index.php(33): Zend_Application->run()  #18 {main}  Request parameters:  array(4) { ["username"]=>  string(5) "admin" ["module"]=>  string(7) "default" ["controller"]=>  string(4) "view" ["action"]=>  string(7) "profile" } 


When I go to www.mydomain.com/view/profile/username/someusername everything works fine though.

2) Second problem is that when I go to URLs such as www.mydomain.com/somecontroller (and somecontroller is and existing controller) I also get a huge error because the URL is matched to the www.mydomain.com/view/profile/username/somecontroller.

How can I solve this problem?

View this message in context: Problem with a simple route
Sent from the Zend MVC mailing list archive at Nabble.com.

2009年10月2日星期五

Re: [fw-mvc] Plugin by name 'Dojo' was not found in the registry when there is *no* Dojo elements in view !

I solved this error.

In bootstrap.php

I replace :

$viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();

By :

$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper(
'ViewRenderer'
);

Could you explain me why it works now ???

Bourth
--
View this message in context: http://www.nabble.com/Plugin-by-name-%27Dojo%27-was-not-found-in-the-registry-when-there-is-*no*-Dojo-elements-in-view-%21-tp25711666p25711901.html
Sent from the Zend MVC mailing list archive at Nabble.com.

Re: [fw-mvc] Plugin by name 'Dojo' was not found in the registry when there is *no* Dojo elements in view !

On Friday 02 October 2009 09:41:38 Bourth wrote:

>I reach a problem : views with Dojo elements works well, but I reach "Plugin

>by name 'Dojo' was not found in the registry" when there is *no* Dojo

>elements in the view !

>

>It fails in layout when : if ($this->dojo()->isEnabled()) {.....}

The dojo view helpers are not in the same location as the standard view helpers. Add the path to the view object plugin loader using either of the following methods:

$view->addHelperPath('Zend/Dojo/View/Helper/', 'Zend_Dojo_View_Helper');

or

Zend_Dojo::enableView($view);

>The error notice :

>2009-10-01T09:06:25+02:00 DEBUG (7): Plugin by name 'Dojo' was not found in

>the registry; used paths: ( see the "/" and "\" . Where do they comes from ?

>)

>Zend_View_Helper_:

>Zend/View/Helper/;./views\helpers/;C:/travail/www/vivier/application/modules

>/default/views\helpers/ #0

> C:\travail\www\vivier\library\Zend\View\Abstract.php(1118):

>Zend_Loader_PluginLoader->load('Dojo')

Your on windows, windows paths are separated by a '\', most php code contains paths with '/' as this is the more commonly used *nix path separator. Don't worry, php is smart enough to figure out where the path goes to with mixed path separators on windows.

--

"Experience is the name everyone gives to their mistakes."

☘ Oscar Wilde