codeigniter functions

edited June 2011 in Share
Hi Everybody, i want to include a codeigniter function like form_open() in a page, it is possible to do????

wheter it is possible, could you give me some example how to do this....

regards.....

Comments

  • edited 8:31AM
    i forgot this

    when i try to do this action returns the next error:

    An Error Was Encountered

    Call to a disallowed php function : form_open

    i hope this helps....
  • edited 8:31AM
    Yeah... you can use any helper and load it just like you would in a normal CI app (autoload, controller, view file etc). Alternatively, FUEL comes with a Form and Form_builder library class (along with it's own Validator class).
  • edited 8:31AM
    Are you adding the function call to a page variable field within the admin? If so, that may be a Dwoo parsing error. If you look at the fuel/application/config/parser.php file you'll see a "parser_allowed_php_functions" configuration parameter which you can add functions that can then be called like so {form_open()}
  • edited June 2011
    WOW you are very quick to answer my question...

    Yes im trying to include within the admin in a page, at this time im not able to see the files via FTP but i will check it as soon as i get to my home thanks for your help!!!!
  • edited 8:31AM
    Thank you so much for fuel cms, Same problem here, using a form i made in ci, using ci form helper.
    I have auto loaded it
    i also changed the page render to cms.
    and allowed form_open and form_input in the parser.php file.

    Now the error i am getting is
    " Plugin Array can not be found, maybe you forgot to bind it if it's a custom plugin ? "

    here is my form view



    <?php echo fuel_var('body');?>


    <?php echo form_open('contact_us/send');?>

    <?php echo form_input('name', '');?>

    <?php echo form_input('email', '');?>

    <?php echo form_input('subject', '');?>

    <?php $textarea = Array ("name" => "message", "cols" => "21", "rows" => "8");?>

    <?php echo Form_textarea($textarea);?>
    <?php echo form_submit('submit', 'Send');?>
    <?php echo form_reset('clear', 'Clear');?>
    <?php echo form_close();?>






    Thanks in Advance.
  • edited 8:31AM
    It's complaining probably because the "Array" function is being used. What happens if you change it to "array"? Also, is this the view file that you imported into your page (not seeing the Dwoo templating syntax e.g. {form_input('subject,'')})
  • edited September 2011
    Thanks for speedy response, ok i will paste the dwoo syntax

    {fuel_var('body')}
    {form_open('contact_us/send')}
    Name: {form_input('name', '')}

    Email:{form_input('email', '')}

    Subject:{form_input('subject', '')}

    {$textarea = Array ("name" => "message", "cols" => "21", "rows" => "8")}
    Message:

    {Form_textarea($textarea)} {form_submit('submit', 'Send')} {form_reset('clear', 'Clear')} {form_close()}

    I tried changing the "Array" to lower case, and that gave this error


    Compilation error at line 86 in "string:" : Parse error in "ame" => "message", "cols" => "21", "rows" => "8")}

    Message:

    {Form_textarea($textarea)} {form_submit('submit', 'Send')} {form_reset('clear', 'Clear')} {form_close()}

    Thanks again
  • edited 8:31AM
    Hi there i have narrowed down the problem to this line

    {$textarea = array ("name" => "message", "cols" => "21", "rows" => "8")}

    if i get rid of the line above, then fuelcms is able to load the page.
  • edited 8:31AM
    You need to use the Dwoo templating syntax so change the => to just "=" and remove the quotes around the key and see if that works.
    http://wiki.dwoo.org/index.php/Helpers:array
  • edited 8:31AM
    Thank you
Sign In or Register to comment.