Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F8198446
TemplateRender.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
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
Wed, Jul 8, 7:41 PM (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1051873
Default Alt Text
TemplateRender.php (1 KB)
Attached To
Mode
R2 kolab
Attached
Detach File
Event Timeline
Log In to Comment