0
votes

I did what it said here: Extbase and Fluid Autocompletion

In NetBeans right-click your Extension project and choose Properties in the opened context menu to edit the project properties. Select the category PHP Include Path and use Add Folder... to add the directories of Extbase and Fluid.

So I added the Fluid and Extbase Folders which I previously copied onto my computer from the Server at /var/www/typo3_src/typo3_src-6.2.25/typo3/sysext:

enter image description here

but it didn't work - here's my Project:

enter image description here

And here is fluid stuff that the editor still doesn't recognize:

enter image description here

What am I doing or thinking wrong?

1
Adding the folder to the PHP include paths only helps the autocompletion in PHP, not in fluid templates. For that, you have to import the XML schemas for fluid and any extensions you use. Here is some info on how to generate and use those (for PhpStorm, but the same thing could work for netbeans).Jost
I can't really figure it out for Netbeans :(Cold_Class

1 Answers

1
votes

Found info here, works for me:

It's an old topic but I have a trick so that you can add Auto-complete function for fluid, vhs, flux.

First of all, download the XSD schema files from here : https://fluidtypo3.org/viewhelpers/fluid/master.html put them somewhere locally.

Next step, in Netbeans, go to menu Tools > DTD and XML Schemas, add your 3 DTD in user catalog :

Flux : Public ID = http://typo3.org/ns/FluidTYPO3/Flux/ViewHelpers URI = path to your flux XDS file

Fluid : Public ID = http://typo3.org/ns/TYPO3/Fluid/ViewHelpers URI = path to your fluid XDS file

Vhs : Public ID = http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers URI = path to your flux VHS file

Next, in project properties, go to 'testing' menu and add the folder where you stored your DTD.

Now, in your Project > Test Files, add a new XML Document and choose "XML Schema-Constrained Document" on next step, click the button 'Browse' and By File > Your Project > Test Files and select import for all the xsd schema files.

Then, change the prefix f for fluid, flux for flux and vhs for vhs choose fluid as primary and finish.

A file is created with this content : And into the section <f:alias>, you have the auto-completion for fluid, vhs and flux.

<f:alias
        xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
        xmlns:f='http://typo3.org/ns/TYPO3/Fluid/ViewHelpers'
        xmlns:vhs='http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers'
        xmlns:flux='http://typo3.org/ns/FluidTYPO3/Flux/ViewHelpers'
        xsi:schemaLocation='http://typo3.org/ns/TYPO3/Fluid/ViewHelpers file:/home/florian/Documents/Docs/Netbeans/Autocomplete%20Fluid/Schemas/Fluid.xsd
   http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers file:/home/florian/Documents/Docs/Netbeans/Autocomplete%20Fluid/Schemas/Vhs.xsd
   http://typo3.org/ns/FluidTYPO3/Flux/ViewHelpers file:/home/florian/Documents/Docs/Netbeans/Autocomplete%20Fluid/Schemas/Flux.xsd'>
   
        Auto-completion here
       
</f:alias>

http://netbeans-org.1045718.n5.nabble.com/Schemas-for-code-completion-with-xsd-tt5752294.html#none

Some more info Use Netbeans to Create Sample XML from XSD

From a project that contains the .xsd:

  1. Click New File on the tool bar or File > New File from the menu
  2. Choose XML > XML Document
  3. Name your file, click next
  4. Choose XML Schema-Constrained Document, click next
  5. Click the Browse button and use By File to navigate to the .xsd
  6. Click the Import check box beside the file name, click next
  7. Review the options available and click Finish to generate

You can use more than one .xsd file to generate the .xml. In this case it will use whichever .xsd file you choose as Primary to resolve any conflicts.