コントローラのアクションによって認識されるように、どのようにしてフラックス対応コントローラに引数を渡す必要がありますか?
私はビルダーを使用して拡張機能を作成し、次のメソッドをContentControllerに追加しました。
/**
* @param string $var
*/
public function exampleAction($var = null) {
var_dump($var);
die;
}
しかし、どのようにURLにパラメータを追加しても、結果として "null"しか取得されません。
拡張機能のディレクトリは "test"です。 $_EXTKEY
。ビルダーは "Mac.Test"を ext_tables.php
registerProviderExtensionKey()の呼び出しの場合そのため、URLではこれらのパラメータを試しました。
http://host/index.php?id=1&tx_test_content[var]=abc
http://host/index.php?id=1&tx_test[var]=abc
http://host/index.php?id=1&tx_mactest_content[var]=abc
http://host/index.php?id=1&tx_mactest[var]=abc
http://host/index.php?id=1&var=abc
そして他にも。しかし無駄に。
私は f:link.action
ViewHelper、結果として
http://localhost/test2/index.php?id=1&no_cache=1&tx_test_content[member]=foo&tx_test_content[action]=example&tx_test_content[controller]=Content
また$ this-> request-> getArguments()は空の配列を返すだけなので、何かひどい間違いがあるはずです。
使用バージョン
PHP 5.6.11
TYPO3 6.2.21
VHS 2.4.0
フラックス7.2.3
流体ページ3.3.1
液体含有量4.3.3
fluidcontent_core 1.3.0
ビルダー1.0.0
他には何もインストールされていません(この動作をテストするための新しいシステムです)。
回答:
回答№1は2流体リンクを使用して、あなたはパラのように渡すことができます
<f:link.action action="example" controller="controllerName" arguments="{var:"abc"}">Go</f:link.action>
次のようにリンクを作成します。
http://host/index.php?id=1&tx_[extension_key]_[fe_plugin_key][var]=abc
さて、extBaseでurlからparaを取得する方法
$arguments = $this->request->getArguments(); // OR
$var = $this->request->getArgument("var");
役に立つリンク: