Creating new PHP function

As I am writing code I may want to interject a new function. Is there a short-cut to open a window to create code the function and then indicate where that funciton is to be saved? Here is an example:

    $fErrorMessage = ValidateFileParameters($fFile);

Can I create the function ValidateFileParameters as I am coding this in another panel?

3 comments
Comment actions Permalink

Hi there,

Such functionality exist for class methods but not for ordinary functions -- you have to create them manually.

P.S.
Alt+Enter when having caret on item in question (or via light bulb icon) -- you should see what intentions are available.

0
Comment actions Permalink

Thank you for the response. I found a way that works just as well, I open the php unit I want to have the function located and I create a split view so I can see the original code that is calling the function allowing me to code the funtion in the unit where I want it.

However, it would be nice to have this as a automated process.

0
Comment actions Permalink

I use the refactor method to create just a normal function from a group of statements. A method is just a class function :)

0

Please sign in to leave a comment.