Project

General

Profile

Actions

Feature #21847

closed

extbase action selection - buttons convenience tweak

Added by Steve Ryan over 14 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2009-12-12
Due date:
% Done:

0%

Estimated time:
PHP Version:
4.3
Tags:
Complexity:
Sprint Focus:

Description

The controller flow autorouting of extbase could be made a little easier to use by by mapping parameters with the name
tx_designatorname_pi1[action][actionName]=Thisis the Label
TO
tx_designatorname_pi1[action]=actionName

before calculating the controller action.

This would allow appropriately named form buttons to directly trigger actions.
eg
<form type="POST">
<input name="tx_des[data][email]" type="text">
<input name="tx_des[data][password]" type="password">
<input name="tx_des[action][save]" type="submit" value="Save" >
<input name="tx_des[action][email]" type="submit" value="Email" >
</form>

A suggested implementation by adding the following lines to the build function in the class Tx_Extbase_MVC_Web_RequestBuilder.
public function build() {
$parameters = t3lib_div::_GPmerged('tx_' . strtolower($this->extensionName) . '_' . strtolower($this->pluginName));
// HACK - seek button clicks as action triggers using the button name prefixId[action][theAction]
if (is_array($parameters['action'])) {
foreach ($parameters['action'] as $k => $v) {
if (strlen($v)>0) $parameters['action']=$k;
}
}

In an extbase extension controller class add the methods
- saveAction and emailAction that debug their names
- indexAction that uses the following template (update the designator)
<form type="POST">
<input name="tx_des[data][email]" type="text">
<input name="tx_des[data][password]" type="password">
<input name="tx_des[action][save]" type="submit" value="Save" >
<input name="tx_des[action][email]" type="submit" value="Email" >
</form>
Check that buttons trigger actions

(issue imported from #M13019)


Files

RequestBuilder-patch.txt (993 Bytes) RequestBuilder-patch.txt Administrator Admin, 2009-12-12 01:17
Actions #1

Updated by Alexander Opitz almost 11 years ago

  • Category deleted (Communication)
  • Status changed from New to Needs Feedback
  • Target version deleted (0)
Actions #2

Updated by Alexander Opitz almost 11 years ago

The issue is very old, does this issue exists in newer versions of TYPO3 CMS (4.5 or 6.1)?

Actions #3

Updated by Alexander Opitz over 10 years ago

  • Status changed from Needs Feedback to Closed

No feedback for over 90 days.

Actions

Also available in: Atom PDF