Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

HMVC

Всем добрый день. Разбираю приложение HMVC В экшене helloAction есть такой код

return new Response('hello there');

Если заменить его на

return 'hello there';

Ничего не меняется, и так и так работает. Вопрос, зачем нужен new Response ?



1.5k
Accepted
answer

first of all english please.

It works because by default the FactoryDefault() already created a response and view.

It will try to load any view if available, and then respond to the request using the response handler.

But when you return a new response, it will not look for any view but just return the text hello there.

pretty sure i am right.

first of all english please.

It works because by default the FactoryDefault() already created a response and view.

It will try to load any view if available, and then respond to the request using the response handler.

But when you return a new response, it will not look for any view but just return the text hello there.

pretty sure i am right.

I'm sorry, thank you