Ticket #94 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Prefix for Memphis Extension doesn't work

Reported by: rist Owned by: mikey
Priority: major Milestone: 0.4.0
Component: Memphis view engine Version: SVN-trunk
Keywords: Cc:

Description

when using (in pages/foo.xml):

<loadExtension extension="org.example.XxxYyy" parts="..." name="myPrefix" />

this should work (snippet from bar.tmpl):

<form method="post" action="...">
  <input name="myPrefix.myKey" type="text" />
</form>

but only this works (snippet from bar.tmpl):

<form method="post" action="...">
  <input name="myKey" type="text" />
</form>

with that method call (snippet from org.example.XxxYyy):

$myKey = $this->request->getValidatedValue($myKeyValidator, 'myKey');

Change History

Changed 3 years ago by mikey

  • status changed from new to assigned

Changed 3 years ago by mikey

  • status changed from assigned to closed
  • resolution set to fixed

Fixed with changeset 1039. To get the prefixed request within the extension, one needs to annotate the setRequest(stubRequest $request) method with @Named('prefixed'):

class MyExtension extends stubMemphisAbstractExtension
{
    /**
     * sets the request instance
     *
     * @param  stubRequest  $request
     * @Inject
     * @Named('prefixed')
     */
    public function setRequest(stubRequest $request) { ... }
    
    ...
}
Note: See TracTickets for help on using tickets.