Jump to content


Photo

Codesense


  • Please log in to reply
8 replies to this topic

#1 Gazley

Gazley

    Sr. Member

  • Members
  • PipPipPipPip
  • 239 posts
  • 38

  • LocationManchester, UK

Posted 07 August 2012 - 02:16 PM

Hi - I use PHP storm and wondered whether anyone has managed to get code completion against the ProcessWire global variables when editing templates?

Thanks!

#2 Pete

Pete

    Administrator

  • Administrators
  • 1,756 posts
  • 658

  • LocationChester, England

Posted 07 August 2012 - 02:24 PM

That's not currently possible, but there is a topic all about it here: http://processwire.c...processwire-30/

PHP Storm and other IDEs are mentioned.

In the meantime, your handiest reference is here: http://processwire.com/api/cheatsheet/

#3 Gazley

Gazley

    Sr. Member

  • Members
  • PipPipPipPip
  • 239 posts
  • 38

  • LocationManchester, UK

Posted 07 August 2012 - 03:40 PM

Hi Pete - thanks for the references. Is the cheatsheet the normal way to go? --Gary

#4 Pete

Pete

    Administrator

  • Administrators
  • 1,756 posts
  • 658

  • LocationChester, England

Posted 07 August 2012 - 03:51 PM

It's the easiest function reference, but not the easiest way to get started - I would try the following:
2, 3 and the help on the forums is where I got started since the walkthrough tutorial wasn't available at the time.

Once I got going and the Cheatsheet was created by Soma it has proven invaluable ever since.

#5 Soma

Soma

    Hero Member

  • Moderators
  • 3,218 posts
  • 1769

  • LocationSH, Switzerland

Posted 07 August 2012 - 03:52 PM

Actually this topic might be better: http://processwire.c...-in-pw-classes/

@somartist | modules created | support me, flattr my work flattr.com


#6 Pete

Pete

    Administrator

  • Administrators
  • 1,756 posts
  • 658

  • LocationChester, England

Posted 07 August 2012 - 03:56 PM

Ah yes - forgot about that one. Once those changes are in it will be in the default download :)

You can download interrobang's version from the link he posts to see if that helps in PHP Storm, but I'd still suggest reading up on the other things above too.

#7 Gazley

Gazley

    Sr. Member

  • Members
  • PipPipPipPip
  • 239 posts
  • 38

  • LocationManchester, UK

Posted 07 August 2012 - 05:37 PM

Thanks Guys!

#8 interrobang

interrobang

    Distinguished Member

  • Members
  • PipPipPipPip
  • 108 posts
  • 50

  • LocationMunich, Germany

Posted 08 August 2012 - 08:09 AM

In order to get use phpstorms codesense you must tell phpstorm what variables are there. Just add a PHPDoc comment like this to your php template files and it should work. Even without using my fork you get some codesense support, but a lot of properties are missing.

/**
* @var Pages $pages
* @var Page $page
* @var Templates $templates
* @var Fields $fields
* @var Users $users
* @var User $user
* @var Roles $roles
* @var Permissions $permissions
* @var WireInput $input
* @var Sanitizer $sanitizer
* @var Session $session
* @var Config $config
*/


#9 ryan

ryan

    Hero Member

  • Administrators
  • 5,812 posts
  • 3140

  • LocationAtlanta, GA

Posted 09 August 2012 - 07:27 AM

I've been adding all of interrobang's PHPDoc comments to the core source code dev branch (great additions interrobang!) so thinking this will help a lot too.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users