Fork me on GitHub

pnForms - embed form in display view?  Bottom

  • Wondering how to embed a pnForm in a display view of another object.

    Trying something like this:

    Code

    // Start display render
         $render = pnRender::getInstance('sb_upshare', false);
       
        $render->assign('invite', $objectData[0]);
        $render->assign('fileArray', $fileArray);
       
            // IF uploads are ok, initiate upload form
        if ($objectData[0]['invite_upload']) {
       
        $upload = FormUtil::newpnForm('sb_upshare_upload');

        // include event handler class
    Loader::requireOnce('modules/sb_upshare/classes/FormHandler/sb_upshare_user_file_edithandler.class.php');

        // build form handler class name
        $handlerClass = 'sb_upshare_user_file_editHandler';
       
                 
            $uploadform = $upload->pnFormExecute('sb_upshare_user_invite_upload.htm', new $handlerClass());
        $render->assign('uploadform', $uploadform);
        }

        return sb_upshare_processRenderTemplate($render, 'user', 'invite', 'display');


    This gives me:


    Smarty error: [in sb_upshare_user_invite_upload.htm line 1]: syntax error: unrecognized tag 'pnform'


    Anyone with an idea on how to embed a small pnForm into another template?

    Thanks for any hints.

    NCM
    SwitchBit
    UHEweb



    edited by: uheweb, Jun 10, 2008 - 11:53 PM
  • I don't know why this happens. Maybe a side effect of the singleton pattern used in pnRender?

    The parameter for newpnForm() should be the module name - just as it is with getInstance(). But I don't think that will fix it.

    The whole idea is although a bit tricky, so I guess you are on your own here.

    /Jørn
  • Oh well, I'll play a little more before implementing it old school icon_smile

This list is based on users active over the last 60 minutes.