forked from koomai/phpstorm-laravel-live-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Laravel_Views_and_Responses.xml
136 lines (135 loc) · 9.45 KB
/
Laravel_Views_and_Responses.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<?xml version="1.0" encoding="UTF-8"?>
<templateSet group="Laravel-Views-and-Responses">
<template name="Response::json" value="Response::json($ARRAY$);$END$" description="Create a JSON Response" toReformat="false" toShortenFQNames="true">
<variable name="ARRAY" expression="" defaultValue=""$array"" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="Response::JSONP" value="Response::json($ARRAY$)->setCallback($CALLBACK$);$END$" description="Create a JSONP Response" toReformat="false" toShortenFQNames="true">
<variable name="ARRAY" expression="" defaultValue=""$array"" alwaysStopAt="true" />
<variable name="CALLBACK" expression="" defaultValue=""Input::get('callback')"" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="Response::download" value="Response::download($PATH$, $NAME$, $HEADERS$);$END$" description="Create a File Download Response" toReformat="false" toShortenFQNames="true">
<variable name="PATH" expression="" defaultValue=""$pathToFile"" alwaysStopAt="true" />
<variable name="NAME" expression="" defaultValue=""$name"" alwaysStopAt="true" />
<variable name="HEADERS" expression="" defaultValue=""$headers"" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="Response::macro" value="Response::macro('$NAME$', function($VALUE$) { $END$ });" description="Create a Response Macro" toReformat="false" toShortenFQNames="true">
<variable name="NAME" expression="" defaultValue=""name"" alwaysStopAt="true" />
<variable name="VALUE" expression="" defaultValue=""$value"" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="Redirect::to" value="Redirect::$TYPE$('$NAME$'$PARAM$); $END$" description="Redirect to URL, Route or Controller" toReformat="false" toShortenFQNames="true">
<variable name="TYPE" expression="enum("to", "route", "action")" defaultValue="" alwaysStopAt="true" />
<variable name="NAME" expression="" defaultValue=""profile"" alwaysStopAt="true" />
<variable name="PARAM" expression="" defaultValue="", $parameters"" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="Redirect::withFlashData" value="Redirect::$TYPE$('$NAME$'$PARAM$)->with('$KEY$', '$VALUE$');$END$" description="Redirect to URL, Route or Controller with Flash Data" toReformat="false" toShortenFQNames="true">
<variable name="TYPE" expression="enum("to", "route", "action")" defaultValue="" alwaysStopAt="true" />
<variable name="NAME" expression="" defaultValue=""profile"" alwaysStopAt="true" />
<variable name="PARAM" expression="" defaultValue="", $parameters"" alwaysStopAt="true" />
<variable name="KEY" expression="" defaultValue=""message"" alwaysStopAt="true" />
<variable name="VALUE" expression="" defaultValue=""Login failed"" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="Redirect::withInput" value="Redirect::$TYPE$('$NAME$'$PARAM$)->withInput($DATA$);$END$" description="Redirect to URL, Route or Controller with Input" toReformat="false" toShortenFQNames="true">
<variable name="TYPE" expression="enum("to", "route", "action")" defaultValue="" alwaysStopAt="true" />
<variable name="NAME" expression="" defaultValue=""profile"" alwaysStopAt="true" />
<variable name="PARAM" expression="" defaultValue="", $parameters"" alwaysStopAt="true" />
<variable name="DATA" expression="" defaultValue=""Input::all()"" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="Redirect::withErrors" value="Redirect::$TYPE$('$NAME$'$PARAM$)->withErrors($DATA$);$END$" description="Redirect to URL, Route or Controller with Errors" toReformat="false" toShortenFQNames="true">
<variable name="TYPE" expression="enum("to", "route", "action")" defaultValue="" alwaysStopAt="true" />
<variable name="NAME" expression="" defaultValue=""profile"" alwaysStopAt="true" />
<variable name="PARAM" expression="" defaultValue="", $parameters"" alwaysStopAt="true" />
<variable name="DATA" expression="" defaultValue=""$validator"" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="Redirect::withInputAndErrors" value="Redirect::$TYPE$('$NAME$'$PARAM$) 		->withInput($INPUT$) 		->withErrors($DATA$);$END$" description="Redirect with Inputs and Errors" toReformat="false" toShortenFQNames="true">
<variable name="TYPE" expression="enum("to", "route", "action")" defaultValue="" alwaysStopAt="true" />
<variable name="NAME" expression="" defaultValue=""profile"" alwaysStopAt="true" />
<variable name="PARAM" expression="" defaultValue="", $parameters"" alwaysStopAt="true" />
<variable name="INPUT" expression="" defaultValue=""Input::all()"" alwaysStopAt="true" />
<variable name="DATA" expression="" defaultValue=""$validator"" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="Response::make" value="Response::make($CONTENT$, $STATUS$, $HEADER$);$END$" description="Create a Custom Response" toReformat="false" toShortenFQNames="true">
<variable name="CONTENT" expression="" defaultValue=""$content"" alwaysStopAt="true" />
<variable name="STATUS" expression="" defaultValue=""200"" alwaysStopAt="true" />
<variable name="HEADER" expression="" defaultValue=""$headers"" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="View::make" value="View::make('$VIEW$', $DATA$);$END$" description="Create a View with Data" toReformat="false" toShortenFQNames="true">
<variable name="VIEW" expression="" defaultValue=""welcome"" alwaysStopAt="true" />
<variable name="DATA" expression="" defaultValue=""$data"" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="View::makeWith" value="View::make('$VIEW$')->with('$KEY$', $VALUE$);$END$" description="Create a View, Pass Data using with()" toReformat="false" toShortenFQNames="true">
<variable name="VIEW" expression="" defaultValue=""welcome"" alwaysStopAt="true" />
<variable name="KEY" expression="" defaultValue=""name"" alwaysStopAt="true" />
<variable name="VALUE" expression="" defaultValue=""$value"" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="View::makeCompact" value="View::make('$VIEW$', compact('$DATA$'));$END$" description="Create a View, Pass Data with compact()" toReformat="false" toShortenFQNames="true">
<variable name="VIEW" expression="" defaultValue=""welcome"" alwaysStopAt="true" />
<variable name="DATA" expression="" defaultValue=""user"" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="View::share" value="View::share('$NAME$', '$VALUE$');$END$" description="Share Data across all Views" toReformat="false" toShortenFQNames="true">
<variable name="NAME" expression="" defaultValue=""name"" alwaysStopAt="true" />
<variable name="VALUE" expression="" defaultValue=""Steve"" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="View::composer" value="View::composer('$NAME$', function($VALUE$) { $END$ });" description="Define a View Composer" toReformat="false" toShortenFQNames="true">
<variable name="NAME" expression="" defaultValue=""name"" alwaysStopAt="true" />
<variable name="VALUE" expression="" defaultValue=""$view"" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="View::composerClass" value="View::composer('$NAME$', '$CLASS$');$END$" description="Define a Class-based View Composer" toReformat="false" toShortenFQNames="true">
<variable name="NAME" expression="" defaultValue=""profile"" alwaysStopAt="true" />
<variable name="CLASS" expression="" defaultValue=""ProfileComposer"" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="View::creator" value="View::creator('$NAME$', function($VALUE$) { $END$ });" description="Register a View Creator" toReformat="false" toShortenFQNames="true">
<variable name="NAME" expression="" defaultValue=""name"" alwaysStopAt="true" />
<variable name="VALUE" expression="" defaultValue=""$view"" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
</templateSet>