Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F120824789
TemplateRender.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
TemplateRender.php
View Options
<?php
namespace
App\Console\Development
;
use
Illuminate\Console\Command
;
class
TemplateRender
extends
Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected
$signature
=
'template:render {template} {--html} {--text} {--pdf}'
;
/**
* The console command description.
*
* @var string
*/
protected
$description
=
"Render a email template."
;
/**
* Execute the console command.
*
* @return mixed
*/
public
function
handle
()
{
$template
=
$this
->
argument
(
'template'
);
$template
=
str_replace
(
"/"
,
"
\\
"
,
$template
);
$class
=
"
\\
App
\\
{$template}"
;
// Invalid template, list all templates
if
(!
class_exists
(
$class
))
{
$this
->
info
(
"Invalid template name. Available templates:"
);
foreach
(
glob
(
app_path
()
.
'/Documents/*.php'
)
as
$file
)
{
$file
=
basename
(
$file
,
'.php'
);
$this
->
info
(
"Documents/$file"
);
}
foreach
(
glob
(
app_path
()
.
'/Mail/*.php'
)
as
$file
)
{
$file
=
basename
(
$file
,
'.php'
);
$this
->
info
(
"Mail/$file"
);
}
return
1
;
}
$mode
=
'html'
;
if
(!
empty
(
$this
->
option
(
'pdf'
)))
{
$mode
=
'pdf'
;
}
elseif
(!
empty
(
$this
->
option
(
'text'
)))
{
$mode
=
'text'
;
}
echo
$class
::
fakeRender
(
$mode
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Apr 24, 10:27 AM (1 d, 12 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
92/dd/fb4d95ce469ade4d3ab31ace20e2
Default Alt Text
TemplateRender.php (1 KB)
Attached To
Mode
rK kolab
Attached
Detach File
Event Timeline