Welcome Guest, Not a member yet? Register   Sign In
Hiding validation callback methods
#2

[eluser]jmb727[/eluser]
If your calling your methods from within the class or from inside a view file thats been loaded in the class, you can simply prefix the methods in question with 'private' or place an underscore infront of your methods name.

You could always do something like this:

Code:
class Foobar extends CI_Controller
{
    public function index() {
    
    }
    
    public function showForm() {
        if (isset($_POST['form_submit'])) {
            // post data found, call processForm method.
            $this->processForm();
        }
        else {
            // post data not found.. show form.
        }
    }
    
    private function processForm() {
        // process your form here.
    }
}

Then point your form like so:

Code:
<form method="post" action="index.php/foobar/showForm">


Messages In This Thread
Hiding validation callback methods - by El Forum - 07-25-2011, 04:30 AM
Hiding validation callback methods - by El Forum - 07-25-2011, 04:43 AM
Hiding validation callback methods - by El Forum - 07-25-2011, 07:14 AM
Hiding validation callback methods - by El Forum - 07-25-2011, 11:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB