I work on a project, built with Lithium PHP framework and some other libraries like the "Resource" library. And so - I have a controller, that starts with:
<?php
namespace app\controllers\admin;
class Prices extends Base {
protected $_parameters = array(
'index' => array(
'prices' => array(
'required' => false,
'call' => array(
'all',
'conditions' => array(
'advertiser' => 'query:advertiser'
)
)
)
)
);
And the problem is that when I open the url with $_GET parameter advertiser
- it is not passed to the model.
BUT - if I hardcode the advertiser ID like this:
...
'prices' => array(
'required' => false,
'call' => array(
'all',
'conditions' => array(
'advertiser' => '123'
)
)
)
and then I get the prices only for this advertiser - as I should.
What could be wrong? ...
You need to setup filter to achieve that, also natebele promised it will refactor li3_resources library to be more flexible: Here is the link to the filter: https://gist.github.com/nateabele/5667381 It also includes simple use case in code comments if you need one.