You have a problem.
There is my route method:
book_list: url: /api/books.:sf_format class: sfDoctrineRoute options: { model: Book, type: list, method: getActiveWithAuthor } param: { module: book, action: list, sf_format: json } requirements: sf_format: (?:json|html)
The code in action is simple:
public function executeList(sfWebRequest $request) { $this->books = $this->getRoute()->getObjects(); }
And a custom method for getting books
public function getActiveWithAuthor(array $parameters) { // crit is easy to find in logs. sfContext::getInstance()->getLogger()->crit(var_export($parameters, true)); return BookQuery::create() ->addSelf() ->addAuthor() ->execute(); }
The problem is that I would like to filter books with the optional parameter "date_from", which can be in the url, for example. / API / books? Date_from = 2011-02-18
But in the log I could only see "sf_format => html" (or json) What should I use to get the optional parameter "date_from"?
source share