About PHPstorm usage tips, PHPstorm usage tips_PHP tutorial

WBOY
Release: 2016-07-12 08:54:22
Original
965 people have browsed it

About PHPstorm usage tips, PHPstorm usage tips

Slowly update, little by little, they are all problems encountered in use

Settings: (2016.4.15)

1: Comment template, phpstorm has a very powerful comment template, which can be changed at any time according to your own needs and set shortcut keys, which is very convenient

New file comment PHP File Header

<span><?<span>php
</span><span>/*</span><span>*
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/4/13
 * Time: 22:44
 </span><span>*/</span></span>
Copy after login

Class Comment PHP Class Doc Comment

<span><span>/*</span><span>*
 * Class index
 *
 * @package application\controller
 * @VERSION 1.3
 * @AUTHOR  mask
 </span><span>*/</span>
<span>class</span> index <span>extends</span><span> controller
{</span></span>
Copy after login

Function Comment PHP Function Doc Comment

<span>    <span>/*</span><span>*获取配置类对象
     *author : stubborRookie
     *
     * @return config
     *version :1.3
     </span><span>*/</span>
    <span>public</span> <span>static</span> <span>function</span><span> config()
    {
        </span><span>return</span> <span>new</span><span> config();
    }</span></span>
Copy after login

Customize your own template:

File->setting->editor->File and code Templates

You can set different display fields according to the rules inside

Custom fields:

Using your own name in comments is usually ${USER} But this defaults to the name of the computer, how do you change it to your own?

You can select the Includes tab, then click on the upper left corner of the panel to create a new template and name it: PHP define (can be customized) extension Namephp

Then write the following code inside:

<span><span>#</span><span>set ($VERSION="1.3")</span><span>
#</span><span>set ($USER='stubbornRookie')</span></span>
Copy after login

Define the variable and assign the value, and introduce it in the template that needs to use the variable, such as:

<span><span>#</span><span>parse("PHP define.php")</span><span>
/*</span><span>
* author = ${USER}
*
* version =${VERSION}
</span><span>*/</span></span>
Copy after login

That’s it!

Enter /** where comments are required, such as the method name, and then press Ctrl enter Autocomplete comments!

Editor Font

can be set in the editor. You need to make a copy of the settings to set it.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1120380.htmlTechArticleAbout PHPstorm usage tips, PHPstorm usage tips are slowly updated, little by little, they are all encountered in use. Question settings: (2016.4.15) 1: Comment template, phpstorm has non...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template