如何在 Netbeans 中激活 Fluid (TYPO3) 自动补全?

How to activate Fluid (TYPO3) autocompletion in Netbeans?

我按照这里所说的做了: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.

所以我添加了之前从服务器 /var/www/typo3_src/typo3_src-6.2.25/typo3/sysext:[= 复制到我计算机上的 Fluid 和 Extbase 文件夹15=]

但没有用 - 这是我的项目:

这里是编辑器仍然无法识别的流动内容:

我做错了什么或想错了什么?

在这里找到信息,对我有用:

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

更多信息Use Netbeans to Create Sample XML from XSD

来自包含 .xsd 的项目:

  1. 单击工具栏上的 New File 或菜单中的 File > New File
  2. 选择XML > XML Document
  3. 命名你的文件,点击下一步
  4. 选择XML Schema-Constrained Document,点击下一步
  5. 单击 Browse 按钮并使用 By File 导航至 .xsd
  6. 点击文件名旁边的Import复选框,点击下一步
  7. 查看可用选项并单击 Finish 生成

您可以使用多个 .xsd 文件来生成 .xml。在这种情况下,它将使用您选择的 .xsd 文件作为 Primary 来解决任何冲突。