Laravel Live Templates for PhpStorm 使用教程

Laravel Live Templates for PhpStorm 使用教程

phpstorm-laravel-live-templatesLaravel Live Templates for PhpStorm项目地址:https://gitcode.com/gh_mirrors/ph/phpstorm-laravel-live-templates

1. 项目的目录结构及介绍

phpstorm-laravel-live-templates/
├── README.md
├── liveTemplates
│   ├── blade.xml
│   ├── laravel.xml
│   ├── php.xml
│   └── routes.xml
  • README.md: 项目说明文件,包含项目的基本信息和使用指南。
  • liveTemplates/: 包含所有Live Templates的配置文件。
    • blade.xml: Blade模板引擎的Live Templates。
    • laravel.xml: Laravel框架的Live Templates。
    • php.xml: PHP语言的Live Templates。
    • routes.xml: 路由配置的Live Templates。

2. 项目的启动文件介绍

该项目没有传统意义上的启动文件,因为它主要是提供Live Templates的配置文件。用户需要将这些配置文件导入到PhpStorm中以启用相应的代码模板。

3. 项目的配置文件介绍

blade.xml

该文件包含Blade模板引擎的Live Templates,例如:

<template name="bform" value="&lt;form method=&quot;POST&quot; action=&quot;$ACTION$&quot;&gt;&#10;    @csrf&#10;    $END$&#10;&lt;/form&gt;" description="Blade form" toReformat="true" toShortenFQNames="true">
    <variable name="ACTION" expression="" defaultValue="" alwaysStopAt="true" />
    <context>
        <option name="HTML" value="true" />
        <option name="PHP" value="true" />
    </context>
</template>

laravel.xml

该文件包含Laravel框架的Live Templates,例如:

<template name="lcontroller" value="class $NAME$Controller extends Controller {&#10;    public function __construct() {&#10;        $END$&#10;    }&#10;}" description="Laravel Controller" toReformat="true" toShortenFQNames="true">
    <variable name="NAME" expression="" defaultValue="" alwaysStopAt="true" />
    <context>
        <option name="PHP" value="true" />
    </context>
</template>

php.xml

该文件包含PHP语言的Live Templates,例如:

<template name="pfunction" value="function $NAME$($PARAMETERS$) {&#10;    $END$&#10;}" description="PHP Function" toReformat="true" toShortenFQNames="true">
    <variable name="NAME" expression="" defaultValue="" alwaysStopAt="true" />
    <variable name="PARAMETERS" expression="" defaultValue="" alwaysStopAt="true" />
    <context>
        <option name="PHP" value="true" />
    </context>
</template>

routes.xml

该文件包含路由配置的Live Templates,例如:

<template name="rget" value="Route::get('$URI$', function() {&#10;    $END$&#10;});" description="Route GET" toReformat="true" toShortenFQNames="true">
    <variable name="URI" expression="" defaultValue="" alwaysStopAt="true" />
    <context>
        <option name="PHP" value="true" />
    </context>
</template>

以上是Laravel Live Templates for PhpStorm项目的目录结构、启动文件和配置文件的详细介绍。用户可以根据这些信息将Live Templates导入到PhpStorm中,以提高开发效率。

phpstorm-laravel-live-templatesLaravel Live Templates for PhpStorm项目地址:https://gitcode.com/gh_mirrors/ph/phpstorm-laravel-live-templates

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

薛珑佳

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值