I am trying to create a library that has a set of functions. I want my form, in my view, to be able to access a function and execute it. Below is my php file, which I placed in the App/Lib folder
myClass.php:
class myClass{
public function someFunction(){
$parentPage =$this->referer();
//do something
$this->redirect($parentPage);
}
}
Then, in my view, I have a form (I am not using form helpers (nor do I want to) that I want to hit my library class, and function, and redirect to a given page (in this example, just the referring page). The problem is, though, that cake always tries to find the function within a controller in the controller folder. How do I tell the form to use a class outside the controller folder?
My view:
<form id="login-user" action="/Lib/myClass/someFunction" method="post">
//form stuff here
</form>
But I get a not found error.
Is this even able to be done?