Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

thewoodcutter's avatar

How can I use a "/public/<dir-name>/*" directory in my controllers and return not 'views' but link references?

I'm having a bit of a hard time and maybe somebody knows how I might substitute a 'return veiw()" for a url at "/public/dw" ? It seems I cannot imagine how to return at the end of my controller methods a url, with variables. What is the function/call and how can I use it?

I have a flash object that I'm trying to understand routing around that I do not know if I can simply put the 'plugin's' entire directory into a 'resources/views/*' directory can I? If I could use the plugin directory in my views folder and reference to their filenames that would maybe work.

Thanks in advance !

0 likes
3 replies
Snapey's avatar

Flash? Seriously?

Sorry but your question does not make any sense.

By the way, you should never have /public/ in your routes. Your web server's document root should be the public folder

thewoodcutter's avatar

Okay, that's actually exactly what I thought. I'm trying over again and starting from the views folder. Sorry if my questions make no sense.

Snapey's avatar

remember that views are only there to be served by routes. your views folders should be out of public reach.

Please or to participate in this conversation.