Laravel Controller - template. suppress the master template
I am getting started with Laravel. I have a controller which shows and
inserts the data. It is similar to
class UserController extends BaseController {
protected $layout = 'layouts.master';
public function showProfile()
{
$this->layout->content = View::make('user.profile');
}
public function addProfile()
{
<Insertion Logic>
echo "Successfully added";
}
}
Now insert is a ajax call. So I want to display the just the Success
message after adding to the database. But in my case the layout content
also shows up. How can I just return the echo message.
Thanks
No comments:
Post a Comment