Post
#1
|
|
|
Grupa: Zarejestrowani Postów: 114 Pomógł: 12 Dołączył: 15.02.2012 Ostrzeżenie: (0%)
|
Czytając dokumentacje trafiłem na http://book.cakephp.org/2.0/en/controllers...troller-actions i zastanawiam się nad tym jak to w praktyce wykożystać:
"If for some reason you?d like to skip the default behavior. Both of the following techniques will by-pass the default view rendering behavior. - If you return a string, or an object that can be converted to a string from your controller action, it will be used as the response body. - You can return a CakeResponse object with the completely created response." Chodzi o pogrubione zdanie.
Wcale nie powoduje wyrenderowania zwracanego stringu tylko wywala błąd o braku widoku dla HelloController::hello(). Co robię nie tak? Ten post edytował spokoloko123 26.04.2013, 17:39:55 |
|
|
|
![]() |
Post
#2
|
|
|
Grupa: Zarejestrowani Postów: 673 Pomógł: 106 Dołączył: 31.12.2008 Ostrzeżenie: (0%)
|
"You can return a CakeResponse object with the completely created response"
albo popełniamy gdzieś jakiś błąd (choć przykłady są tak banalne, że wątpię) albo oni go mają (IMG:style_emoticons/default/smile.gif) ...mimo wszystko jednak nie polecam ani return, ani przykładu podanego przeze mnie (czemu kontroler ma przejmować czynności należące do widoku?) |
|
|
|
spokoloko123 [CakePHP] Zastąpienie domyślnego renderowania. 26.04.2013, 17:39:07
kleus przejzyj dokladnie http://book.cakephp.org/2.0/en/... 27.04.2013, 08:46:25
spokoloko123 Nie chodzi mi o zwracanie obiektu CakeResponse, a ... 1.05.2013, 13:09:11 ![]() ![]() |
|
Aktualny czas: 28.12.2025 - 19:11 |