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?
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
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
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
-----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