Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello guys.. does anyone of you have tried using cakephp?
You see i want to test something. I created an app on cakephp and I create a controller named testscontroller.php now inside that controller I have an action of echoMe() its something like this
PHP
class TestsController extends AppController {

  function echoMe(){

    echo "Hello";
  }
}

As you can see I just want to echo something inside an action of my controller although i know that every action should have its own view... but what if i dont want to create a view. what i want is to have an action that will only do some processing but no view will return... so how will i achieved this? my problem is with my code it generates an error asking for a view.. but i don't want a view all i want is to echo it inside my action(for processing purpose).

To make things clear im doing an ajax request that calls the echoMe() action and inside that echo me i want to do a json_encode reply. but the problem is the reply is giving me the entire html file with an error that says /views/echoMe.ctp cannot be found... I dont want it to look for the view but instead i just want it to echo a value not the entire html document.

Hope you can help me guys... thanks
Posted
Updated 11-Jul-12 0:09am
v3
Comments
Mohibur Rashid 11-Jul-12 6:05am    
Question is not clear

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900