Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [CakePHP] Zastąpienie domyślnego renderowania.
spokoloko123
post
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.

  1. <?php
  2.  
  3. class HelloController extends AppController {
  4. public function hello(){
  5. return '<p>Hello World!</p>'
  6. }
  7. }
  8.  
  9. ?>


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
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 5.10.2025 - 08:34