[Agavi-Users] Slots and Parameters not set

10 views
Skip to first unread message

André Fiedler / ö_konzept Zwickau

unread,
Jan 26, 2012, 10:03:36 AM1/26/12
to Agavi Users Mailing List

Hi,

 

I´ve defined an slot in output_types.xml and tried to pass parameters to this slot like this:

 

<slot name="javascript" module="Application" action="Widgets.Foo">

    <ae:parameter name="type">javascript</ae:parameter>

</slot>

 

But if I try to read this parameter in the execute (or executeRead) method of the Widgets.FooAction, its empty. Why?

 

public function executeRead(AgaviRequestDataHolder $rd) {

        $this->context->getLoggerManager()->log('action: ' . $rd->getParameter(‘type’) . "\n");

}

 

Any hints why this is happen?

Marius Hein

unread,
Jan 26, 2012, 10:40:36 AM1/26/12
to Agavi Users Mailing List
On 26/01/12 16:03, André Fiedler / ö_konzept Zwickau wrote:
> Hi,
>
>
>
> I´ve defined an slot in output_types.xml and tried to pass parameters to
> this slot like this:
>
>
>
> <slot name="javascript" module="Application" action="Widgets.Foo">
>
> <ae:parameter name="type">javascript</ae:parameter>
>
> </slot>
>

You need to things that an argument comes in: An action with execute
function and a validator.

Maybe something like this is missing:

<validator name="type" class="string" required="false">
<argument>type</argument>
</validator>

Kind regards,
Marius.


--
http://www.itsocks.de - Deep in their roots all flowers keep the light.
PGP: 0x53FA79D0 (https://users.itsocks.de/~mhein/pgp/mhein.asc)


_______________________________________________
users mailing list
us...@lists.agavi.org
http://lists.agavi.org/mailman/listinfo/users

André Fiedler / ö_konzept Zwickau

unread,
Jan 26, 2012, 11:12:12 AM1/26/12
to Agavi Users Mailing List
Hi Marius,

that´s it! Thanks a lot! I forgotten the validator ... damn


Mit freundlichen Grüßen aus Zwickau
André Fiedler
 
--------------------------------------------------------------
Dipl.-Ing. (FH) André Fiedler
Abteilung Internet
 
----------------------------------------------------------------------------
-----------------
Neu: unser CMS für Internet / Intranet http://www.redaktoer.info
----------------------------------------------------------------------------
-----------------
ö_konzept
Agentur für Werbung und Kommunikation GmbH & Co.KG
Audistraße 3
08058 Zwickau
 
Telefon:     0375 / 2 11 94 31
Telefax:     0375 / 2 11 94 19
Internet:     http://www.oe-konzept.de
E-Mail:      a.fi...@oe-konzept.de

Sitz: Zwickau
Amtsgericht Chemnitz, HRB 12402
Geschäftsführer: Klaus Blechschmidt


-----Ursprüngliche Nachricht-----
Von: users-...@lists.agavi.org [mailto:users-...@lists.agavi.org] Im
Auftrag von Marius Hein
Gesendet: Donnerstag, 26. Januar 2012 16:41
An: Agavi Users Mailing List
Betreff: Re: [Agavi-Users] Slots and Parameters not set

David Zülke

unread,
Jan 28, 2012, 8:17:36 AM1/28/12
to Agavi Users Mailing List
If the slot is only used internally by the application, you can also set it to "simple" mode:

class MyAction extends ... {
public function isSimple() {
return true;
}
}

The action is then skipped entirely and Agavi jumps straight to the view given by getDefaultViewName(), where you do not have access to any request data except values passed in code to the slot.

Remember that in many cases, it makes sense to do this in code rather than the layout; you typically should not have more than a few layouts and instead use code for more dynamic situations:

class MySuccessView extends ... {
public function executeHtml($rd) {
$this->setupHtml($rd); // $this->loadLayout();
$a = new AgaviRequestDataHolder();
$a->setParameters(array(...));
$this->getLayer('content')->getSlot('foo')->setArguments($a);
}
}

- David

André Fiedler / ö_konzept Zwickau

unread,
Jan 30, 2012, 2:54:58 AM1/30/12
to Agavi Users Mailing List
Great! Thanks a lot David, I didn´t know this. :o)

-----Ursprüngliche Nachricht-----
Von: users-...@lists.agavi.org [mailto:users-...@lists.agavi.org] Im

Auftrag von David Zülke
Gesendet: Samstag, 28. Januar 2012 14:18


An: Agavi Users Mailing List
Betreff: Re: [Agavi-Users] Slots and Parameters not set

If the slot is only used internally by the application, you can also set it

Reply all
Reply to author
Forward
0 new messages