Bug #8439
Fix Namespace support in processor notation
Status: | Resolved | Start date: | 2010-06-22 | |
---|---|---|---|---|
Priority: | Must have | Due date: | ||
Assigned To: | Bastian Waidelich | % Done: | 100% |
|
Category: | - | |||
Target version: | - |
Description
Processor methods can either be within the default namespace or must be specified with the full component name. Since PHP supports propper namespaces, specifying the full object name does not work anymore.
The reason is, that the regular expression (SPLIT_PATTERN_INDEXANDMETHODCALL) does not allow backslashes.
An option would be to change the regular expression from
/(?P<Index>\d+)\.(?P<ObjectAndMethodName>\w+)\s*\((?P<Arguments>.*?)\)\s*$/
to
/(?P<Index>\d+)\.(?P<ObjectAndMethodName>[^\(]+)\s*\((?P<Arguments>.*?)\)\s*$/
Related issues
Associated revisions
[+BUGFIX] TypoScript: fixed namespace support in processor notation. "foo << 1.bar:baz()" expects a BazProcessor in the subfolder Processors of the bar namespace. This fixes #8439
History
#1 Updated by Bastian Waidelich about 5 years ago
- Status changed from New to Accepted
- Assigned To set to Bastian Waidelich
- % Done changed from 0 to 50
Some additional infos:
Following should be possible
foo << 1.bar()
Expects A Class BarProcessor in the subfolder Processors of the default namespace.
---
foo << 1.\F3\MyCustom\Namespace->bar.bar()
Expects A Class BarProcessor in the folder MyCustom/Namespace/Processors.
---
namespace: custom = F3\MyCustom\Namespace foo << 1.custom->bar.bar()
Expects A Class BarProcessor in the folder MyCustom/Namespace/Processors.
#2 Updated by Sebastian Kurfuerst about 5 years ago
Hey,
foo << 1.\F3\MyCustom\Namespace->bar.bar()
should we support this notation? I'd be fine if you would need to always import the namespace, just as it is in Fluid.
Additionally, I'd suggest ":" as separator between namespace and method:
custom:myProcessor()
By using \..\..->..., I think people will confuse it with objects...
What do you think?
Greets,
Sebastian
#3 Updated by Bastian Waidelich about 5 years ago
Sebastian Kurfuerst wrote:
should we support this notation? I'd be fine if you would need to always import the namespace,
just as it is in Fluid.
Additionally, I'd suggest ":" as separator between namespace and method:
You're right, I was just thinking the same. And I think, we actually already decided to do so in the t3p-chat.
#4 Updated by Bastian Waidelich about 5 years ago
- Status changed from Accepted to Resolved
- % Done changed from 50 to 100
Applied in changeset r4792.