Can't ->Draw() with templates

Last post 02-26-2009, 1:07 AM by Tangle. 3 replies.
Sort Posts: Previous Next
  •  01-18-2009, 11:23 PM 47844

    Can't ->Draw() with templates

    I bought the PHP package but am handcuffed because i do all the preprocessing in PHP but then call HTML templates and inject PHP variables into them to do the presentation layer.  The HTML template page creates all the forms, graphics, etc.  In other words, I can't call ->Draw() because the PHP runs completely before the page layout runs.
     
    How do I capture all of the code that the CuteEditor object will spew into the page in order to place it where i need it through the template?  In the HTML, I need to say [var.cuteEditorCode] with the HTML setup that I captured.  Is there a method for that?
     
     

  •  01-19-2009, 2:15 PM 47874 in reply to 47844

    Re: Can't ->Draw() with templates

  •  02-26-2009, 12:50 AM 49248 in reply to 47844

    Re: Can't ->Draw() with templates

    I'm having a similar problem.  I'm not using smarty - this is an entirely custom coded solution, built using some content management classes I wrote about five years ago, and have been refining since.  
     
    In this case, nesting PHP is an integral part of the system, something too fundamental for me to change or hack to create an exception for the text editor.  
     
    The gist of it is that there are a series of 'collector' classes which assemble the PHP from various components, and then through that nesting of the PHP vars , the page can be assembled in the last ten lines of the last file by echoing out the top level objects.  It works really well, and I don't want to have to rethink it.
     
    In this instance, there is a $Form class within a $UI class, which is then incorporated into a $Content class , which is exists as a child of the $Site class.  The CuteEditor was intended to be called as a function of the $Form class, something like  $Form->CuteEditor();
     
    However, with the Draw method, it just renders to the top of the page, just like in the above example.
     
    I have developed a decent workaround by containing the CuteEditor in an IFRAME, but that breaks the fullscreen mode.  Within an IFRAME, the fullscreen mode does nothing because the frame already exactly matches the proportions of the editor.  And then on top of that, there's a bit of a javascript workaround required to grab the  contents of the editor, inside the IFRAME, and post it to the processing script.
     
    So - summed up - all I really need is a way to return the class as a variable, and print it when I'm good and ready.  Any suggestions?
     
     
  •  02-26-2009, 1:07 AM 49249 in reply to 47844

    Re: Can't ->Draw() with templates

    And another few minutes of fiddling around and I got it. 
     
    Using $editor->GetString(); instead of $editor->Draw(); is the answer.
     
     
View as RSS news feed in XML