Calling action in controller.php from blocks view.php
Permalink
Hi
I want something simple. I want to call a function in my controller.php from my view.php. I want to load it with jquery's "get" function.
I did the same already in single pages and there its working without a problem. But in a normal block it's not. The return is always the full page, it can't access the action in the controller.php.
Code in view.php, something like this:
Code in controller.php, something like this:
I tried already to rename the call or function without the "action_" in the name, but just nothing works. What am I doing wrong? I'm sure it's something very simple... and I'm just to blind!
I want something simple. I want to call a function in my controller.php from my view.php. I want to load it with jquery's "get" function.
I did the same already in single pages and there its working without a problem. But in a normal block it's not. The return is always the full page, it can't access the action in the controller.php.
Code in view.php, something like this:
$.get("<? echo $this->action('action_myaction'); ?>", function(data){ //do something });
Code in controller.php, something like this:
I tried already to rename the call or function without the "action_" in the name, but just nothing works. What am I doing wrong? I'm sure it's something very simple... and I'm just to blind!
Found it (the first & is a &-a-m-p-; without the -, editor changes it always):
Did the trick, maybe it helps someone else. Case closed!