Welcome Guest, Not a member yet? Register   Sign In
How to call a new application with parameter
#1

[eluser]Unknown[/eluser]
I write a new application like this
Code:
class Blog extends Controller {
function onedit($id = 0 ,$arr= array())
{
                echo "<pre>";
print_r($arr);
}
function index()
    {
    
        $this->load->view('blog_view',$data);
    }

}

I can using http://mysite.com/blog/

to call Class Blog
But if I want to call the function onedit


And if I using like
Code:
&lt;?=form_open('blog/onedit')?&gt;

how can I assign these parameter for function onedit

thanks
#2

[eluser]pickupman[/eluser]
I would assume you are posting form fields, so there is no need to fetch these like you are thinking. You don't need to set them in the function parameters. You should use form validation class, and then retrieve the fields using:

Code:
function onedit($id = '0'){

  $title = $this->input->post('title'); //title form field
  $content = $this->input->post('content'); //content form field

}




Theme © iAndrew 2016 - Forum software by © MyBB