i'm using nodejs + express + ejs and i am having a problem when i try to include another view.
When I try:
<% include dochead %>
I get 'unexpected identifier';
when i try:
<% include /admin/global/dochead %>
I get 'include is not defined';
What is going on? Thanks
Try
<%- include ('dochead') %>
or
<%- include ('admin/global/dochead') %>
set
app.set('view engine', 'ejs');
app.set('views', 'YOUR CUSTOM VIEW FOLDER PATH FROM ROOT FILE');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With