1 | <?php |
||
22 | class OldFormViewHelper extends FormViewHelper |
||
23 | { |
||
24 | /** |
||
25 | * Render the form. |
||
26 | * |
||
27 | * @param string $action Target action |
||
28 | * @param array $arguments Arguments |
||
29 | * @param string $controller Target controller |
||
30 | * @param string $extensionName Target Extension Name (without "tx_" prefix and no underscores). If NULL the current extension name is used |
||
31 | * @param string $pluginName Target plugin. If empty, the current plugin name is used |
||
32 | * @param int $pageUid Target page uid |
||
33 | * @param mixed $object Object to use for the form. Use in conjunction with the "property" attribute on the sub tags |
||
34 | * @param int $pageType Target page type |
||
35 | * @param bool $noCache set this to disable caching for the target page. You should not need this. |
||
36 | * @param bool $noCacheHash set this to suppress the cHash query parameter created by TypoLink. You should not need this. |
||
37 | * @param string $section The anchor to be added to the action URI (only active if $actionUri is not set) |
||
38 | * @param string $format The requested format (e.g. ".html") of the target page (only active if $actionUri is not set) |
||
39 | * @param array $additionalParams additional action URI query parameters that won't be prefixed like $arguments (overrule $arguments) (only active if $actionUri is not set) |
||
40 | * @param bool $absolute If set, an absolute action URI is rendered (only active if $actionUri is not set) |
||
41 | * @param bool $addQueryString If set, the current query parameters will be kept in the action URI (only active if $actionUri is not set) |
||
42 | * @param array $argumentsToBeExcludedFromQueryString arguments to be removed from the action URI. Only active if $addQueryString = TRUE and $actionUri is not set |
||
43 | * @param string $fieldNamePrefix Prefix that will be added to all field names within this form. If not set the prefix will be tx_yourExtension_plugin |
||
44 | * @param string $actionUri can be used to overwrite the "action" attribute of the form tag |
||
45 | * @param string $objectName name of the object that is bound to this form. If this argument is not specified, the name attribute of this form is used to determine the FormObjectName |
||
46 | * @param string $hiddenFieldClassName |
||
47 | * @param string $addQueryStringMethod |
||
48 | * @return string rendered form |
||
49 | */ |
||
50 | public function render($action = null, array $arguments = [], $controller = null, $extensionName = null, $pluginName = null, $pageUid = null, $object = null, $pageType = 0, $noCache = false, $noCacheHash = false, $section = '', $format = '', array $additionalParams = [], $absolute = false, $addQueryString = false, array $argumentsToBeExcludedFromQueryString = [], $fieldNamePrefix = null, $actionUri = null, $objectName = null, $hiddenFieldClassName = null, $addQueryStringMethod = '') |
||
54 | } |
||
55 |
Let’s assume that you have a directory layout like this:
and let’s assume the following content of
Bar.php
:If both files
OtherDir/Foo.php
andSomeDir/Foo.php
are loaded in the same runtime, you will see a PHP error such as the following:PHP Fatal error: Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.php
However, as
OtherDir/Foo.php
does not necessarily have to be loaded and the error is only triggered if it is loaded beforeOtherDir/Bar.php
, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias: