Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/laravel-china/phpstorm-livetemplates

Collections of PhpStorm-LiveTemplates
https://github.com/laravel-china/phpstorm-livetemplates

Last synced: about 2 months ago
JSON representation

Collections of PhpStorm-LiveTemplates

Awesome Lists containing this project

README

        

# PhpStorm-LiveTemplates
Collections of PhpStorm-LiveTemplates

## Installation

First, find your configuration folder.

Windows: \.WebIde\config
Linux: ~\.WebIde\config
MacOS: ~/Library/Preferences/WebIde

On my MacOS, it would be `~/Library/Preferences/WebIde80` so you have to adjust commands to your platform. There is a `templates/` directory. It contains XML files with Live Templates.

Create a git repository in the `templates/` dir and pull the templates
```bash
$ cd ~/Library/Preferences/WebIde80/templates
$ git init
$ git remote add origin [email protected]:laravel-china/PhpStorm-LiveTemplates.git
$ git pull origin master
```
If this wouldn't work, you should just backup your templates, clone the repo and merge them manually.

##Forms

**fo** Form open tag
```php
{!! Form::open() !!}
```

**fc** Form close tag
```php
{!! Form::close() !!}
```

**textfield** Text form field
```php


{!! Form::label('$NAME$', '$VALUE$:') !!}
{!! Form::text('$NAME$', null, ['class' => 'form-control']) !!}

```

**emailfield** Email form field
```php


{!! Form::label('$NAME$', '$VALUE$:') !!}
{!! Form::email('$NAME$', null, ['class' => 'form-control']) !!}

```

**passwordfield** Password form field
```php


{!! Form::label('$NAME$', '$VALUE$:') !!}
{!! Form::password('$NAME$', ['class' => 'form-control']) !!}

```

**textareafield** Text area form field
```php


{!! Form::label('$NAME$', '$VALUE$:') !!}
{!! Form::textarea('$NAME$', null, ['class' => 'form-control']) !!}

```

**hiddenfield** Hidden form field
```php
{!! Form::hidden('$NAME$', $VALUE$) !!}
```

**submitfield** Submit form field
```php


{!! Form::submit('$NAME$', ['class' => 'btn btn-primary']) !!}

```

**req** Require field (add in the attribute array of any form field type to make field required.
```php
'required' => 'required'
```