Determining the form action
I am very new to Concrete5 and have created a package with a block within it. From within my block's view.php, I can direct a form's action to my blocks' controller.php "action_something" function by calling $this->action('something'). However, this renders a not so user friendly address and presents the users with something like "index.php?cID=1&bID=12&arHandle=Main.........". Basically a very, very long address. Is there any way to avoid this? Isn't there a pretty URL which I can just write in my form's action to make my "action_something" function execute? Perhaps I have to redirect the user after doing whatever I have to do within that function?
Also, I am wondering what I would generally use my package's controller for except installing/uninstalling. Like what I would put in the block's controller and what belongs to the package's controller. Say, for instance, that I want to make a post request to a function in my package's controller; which URL would I use? Can I render a view from my package controller? I come from a more strict MVC background, so I find the concept of so many different controllers rather confusing.
I apologize for the amount of questions, but some things are slightly difficult to grasp at first, and the documentation is not always very helpful.
Thanks in advance!
Another approach is to submit your form via AJAX so the user doesn't have to leave the page.
Or you could create a single page with pretty URLs to handle the form submissions - probably more work than the redirect option though.
If you want to target a post request at something other than the block controller or a block tool, it will usually be to a package tool or single page controller within the package.
I ended up using <?php echo View::url($c->getCollectionPath()); ?>. :-)