Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>ProcessWire SnippetsNew to Visual Studio Code? Get it now.
ProcessWire Snippets

ProcessWire Snippets

Bernhard Baumrock

|
1,288 installs
| (2) | Free
Snippets for rapid PHP Development with the ProcessWire CMS/CMF
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

ProcessWire Snippets

Snippets for rapid PHP Development with the ProcessWire CMS/CMF

VSCode Marketplace: https://marketplace.visualstudio.com/items?itemName=baumrock.pwsnippets

Features

Please see section Contributing how you can add features!

I'm using the Intelephense extension for Code Intellisense in PHP in the examples.

pw: Add ProcessWire Namespace

img

pwire: Add wired object

img

pwnew: Wire new instance of a Class

img

pwhookargument: Get hook argument

img

pwhookobject: Get hook object

img

pwmod: Get ProcessWire Module

img

pwmodule: PW Module Boilerplate

img

pwtextformatter: PW Textformatter Boilerplate

img

pwinputfield: Add Inputfield Boilerplate

img

pwfieldtype: Add Fieltype Boilerplate

img

pwprocessmodule: Add ProcessModule Boilerplate

img

pwexecuteFoo

img

pwModuleConfigClass: Add PW Module Config Class Boilerplate

img

pwSqlQuery: Query the database via SQL

img

img

pwex and pwex404: Throw WireExceptions

img

pwhook and pwHookInline: Attaching hooks

img

pwResetAdmin

img

Contributing

First, create your snippet in your users folder to test it! See docs

When it works, go to your VSCode Extensions folder

cd C:\Users\foo\.vscode\extensions\

If you have PWSnippets extension installed, uninstall it (or delete the folder now)!

Fork this Repo into your Github account and clone it into the extensions folder:

git clone git@github.com:yourGitAccount/pwsnippets.git

Create a test-file and check that the extension works:

cd pwsnippets
touch test.php

Open the extension's folder in VSCode:

img

Now open test.php and type pw. The PW Namespace snippet should pop up:

img

Now open snippets/php.json and add this test-snippet to your json:

"pw-test": {
  "prefix": "pwtest",
  "body": [
    "PWTest working!"
  ],
  "description": "Test Snippet"
}

Make sure to separate all snippet objects by commas except the last one (it needs to be valid JSON syntax)!

Reload the window!

Go to test.php and type pwtest:

img

Now add your own snippets. When done create a Pull Request so that I can update the VSCode Extension.

Thank you :)

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft