In my component methods, how can I get the request data that is normally read by the controller?
class MyComponent extends Component {
public function processData() {
// Get the data normally found in $this->request->data
}
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here are 2 ways to do this, second way is simpler:
Add this in your component
You can then access the request data in the component by doing:
Or alternatively, you could just pass it through to your function.
E.g.
And then call it with