Check out 
http://groups.google.com/group/agavi-users/browse_thread/thread/9890cf5cf93d03f3#

That thread has a solution for the problem with forwarding and errors.

- David



On 04.03.2009, at 14:19, Liutauras wrote:

Ok, i started from begining maybe i missed smthg.

I. I downloaded latest sources sample app.
And that what i made:
in routing.xml
----------------------
     <route module="Forwarder" name="forwarder" pattern="^/forwarder">
       <route action="Index" name=".index" pattern="^/index$" />
     </route>
-----------------------

II. created module Forwarder with Index action, in its View i write:
------------------------
public function executeHtml(AgaviRequestDataHolder $rd)
{
       $this->setupHtml($rd);
       return
$this- >createForwardContainer(AgaviConfig::get('actions.login_module'),
AgaviConfig::get('actions.login_action'), $rd);
}
-------------------------

III. In Default/templates/Login_Input.php
changed form action from $ro->gen('login'); to $ro->gen(null);

IV. created menu item like this:
$items[$this->ro->gen('forwarder.index')] = $this->tm->_('Forwarder to
Login', 'default.menu');

V. now i go tu url like:
http://localhost/samples/pub/index.php/en/forwarder/index
and see forwarded LoginInput Form here, now if i Submit i stay all time
in the same URL becouse LoginInput has $ro->gen(null); And all
time my request is forwarded to Default/LoginAction. If i enter correct
login data i can login in Sample app.
But errors is not shown at all, all time..

If i check for errors in
Default/LoginView::executeHtml(AgaviRequestDataHolder $rd) {..
print_r($this->container->getValidationManager()->getErrors());
i see what i have submitted data like :

Array
(
   [username] => Array
       (
           [messages] => Array
               (
[0] => The username you supplied is fewer than 5 characters long.
               )

           [validators] => Array
               (
                   [0] => username_too_short
               )

       )

)

As u suggested i tryed to place in LoginErrorView
$this->context->getRequest()->setAttribute('populate', true, 'org.agavi.filter.FormPopulationFilter');
No gives no effect.


But errors are still not printed at all.
Thats the end? :(
Again my BIG routing file must be, or all templates copy/paste error
printing foreach(errors as error) ... echo error ;



_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users


Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users

Reply via email to