Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Problem in extending form class . is this a bug?
  • Hello all , when i tried to extend the form i got the following error. when i changed the core function to protected it worked is this the bug?
    ErrorException [ Error ]: Call to private method Form::attr_to_string() from context 'Fuel\Core\Form'
    COREPATH/classes/form.php @ line 436 Secondly
    echo \Form::input(array('type'=>'image','name'=>'add_dept','src'=>Asset::img('add.png')));
    showed me in the browser
    " value="" id="form_add_dept" />
  • Hello all , when i tried to extend the form i got the following error. when i changed the core function to protected it worked is this the bug?
    ErrorException [ Error ]: Call to private method Form::attr_to_string() from context 'Fuel\Core\Form'
    COREPATH/classes/form.php @ line 436
    Yes that should have been protected instead of private, has been fixed in the develop branches.
    Secondly
    echo \Form::input(array('type'=>'image','name'=>'add_dept','src'=>Asset::img('add.png')));
    showed me in the browser
    " value="" id="form_add_dept" />
    The problem here is that it always adds a value attribute? Is that invalid HTML?
  • Secondly
    echo \Form::input(array('type'=>'image','name'=>'add_dept','src'=>Asset::img('add.png')));
    showed me in the browser
    " value="" id="form_add_dept" />
    The problem here is that it always adds a value attribute? Is that invalid HTML?[/quote]
    no Jelmer i think u misread the thing i m trying to say.I am trying to say that the browser shows
    " value="" id="form_add_dept" />
    when i tried to use the
    echo \Form::input(array('type'=>'image','name'=>'add_dept','src'=>Asset::img('add.png')));
    
    code . Is this the way to use image using form_input() method?
  • Doesn't form::input() generate an <input> tag? I'm clueless why you want to use that with an image...
  • i want to use
    <input type="image" src="<?php echo Asset::img();?>">
    Is this possible or not? i thought it would be possible to do. using form class
  • Ah, never used that, I always use a button tag for that. Is it an issue that the empty value is part of the tag?
  • ok ill try the button instead of the image.thank u everyone
  • @samitral: was that the HTML source or what you got to see after the browser tried to interpret it?

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion