# |
May 15th 2019, 18:23 |
ricksaccous |
if ($this->getRequest()->getParam('someparam') !== in_array(['pdf', 'json']) { } |
# |
May 15th 2019, 18:22 |
ricksaccous |
yeah |
# |
May 15th 2019, 18:22 |
m.hoffs |
it is in my appcontroller |
# |
May 15th 2019, 18:22 |
ricksaccous |
you can set it based on router params with if statements |
# |
May 15th 2019, 18:22 |
m.hoffs |
hmmm |
# |
May 15th 2019, 18:22 |
ricksaccous |
not all the time |
# |
May 15th 2019, 18:22 |
m.hoffs |
so thats allready a win win |
# |
May 15th 2019, 18:22 |
ricksaccous |
you want to only set that view class conditionally |
# |
May 15th 2019, 18:22 |
ricksaccous |
yep |
# |
May 15th 2019, 18:22 |
ricksaccous |
heh |
# |
May 15th 2019, 18:21 |
m.hoffs |
it start serving a pdf |
# |
May 15th 2019, 18:21 |
m.hoffs |
$this->viewBuilder()->setClassName('AdminLTE.AdminLTE'); |
# |
May 15th 2019, 18:21 |
m.hoffs |
when i uncomment this one |
# |
May 15th 2019, 18:21 |
m.hoffs |
but u cracked if a bit |
# |
May 15th 2019, 18:21 |
ricksaccous |
ok |
# |
May 15th 2019, 18:21 |
m.hoffs |
yes |
# |
May 15th 2019, 18:21 |
ricksaccous |
it should be according to the plugin docs |
# |
May 15th 2019, 18:21 |
ricksaccous |
is your url with '_ext' => 'pdf'? |
# |
May 15th 2019, 18:20 |
ricksaccous |
also |
# |
May 15th 2019, 18:19 |
m.hoffs |
ok |
# |
May 15th 2019, 18:19 |
ricksaccous |
$this->viewBuilder()->setClass or something? |
# |
May 15th 2019, 18:19 |
ricksaccous |
heh |
# |
May 15th 2019, 18:19 |
m.hoffs |
i `m not so expert |
# |
May 15th 2019, 18:19 |
ricksaccous |
well i was basically stopping cake from giving me json serializable magic and json views |
# |
May 15th 2019, 18:19 |
m.hoffs |
so i can search in my code |
# |
May 15th 2019, 18:19 |
m.hoffs |
with what command did u do that > |
# |
May 15th 2019, 18:19 |
m.hoffs |
hmmm |
# |
May 15th 2019, 18:18 |
ricksaccous |
i honestly don't really know but i've had a problem before where my viewClass was being set and it was not allowing another plugin to do it's thing |
# |
May 15th 2019, 18:18 |
m.hoffs |
by adding them manual to viewClassMap ? |
# |
May 15th 2019, 18:17 |
m.hoffs |
not that i know |
# |
May 15th 2019, 18:16 |
ricksaccous |
@m.hoffs are you setting a custom view class anywhere? |
# |
May 15th 2019, 18:11 |
m.hoffs |
but now see same problem with the cakepdf |
# |
May 15th 2019, 18:11 |
m.hoffs |
but that i sorted out different way, didnt pay attention on it |
# |
May 15th 2019, 18:11 |
m.hoffs |
and got simular problem with Csvview |
# |
May 15th 2019, 18:11 |
m.hoffs |
"viewClassMap" => array:5 [▼ "json" => "Json" "xml" => "Xml" "ajax" => "Ajax" "csv" => "CsvView.Csv" "pdf" => "CakePdf.Pdf" |
# |
May 15th 2019, 18:09 |
m.hoffs |
but my feeling its not getting to that class at all |
# |
May 15th 2019, 18:09 |
m.hoffs |
i can see in the request RequestHandler that the CakePdf class is loaded |
# |
May 15th 2019, 18:08 |
m.hoffs |
but its serving normal view |
# |
May 15th 2019, 18:08 |
m.hoffs |
so pthat part can confirm is working |
# |
May 15th 2019, 18:08 |
m.hoffs |
when i open the url, its forcing application/pdf |
# |
May 15th 2019, 18:08 |
m.hoffs |
added the router extension |