Plugin template Render as String

I have a question,
how can и Render Plugin Template in the Plugin without Мasterview as String and then pass both "echo "

example:
$templateString = $Sender->Render($this->GetView(test.php));
echo templateString ;

thank you in advance

###### German

Ich habe eine Frage,
wie kann ein Plugin Template rendern ohne Мasterview und als String an Echo übergeben

Beispiel:
$ templateString = $ Sender- > Render ( $ this-> GetView ( test.php ));
echo templateString ;

danke im Voraus

Comments

  • Maybe simply with an include...

    ob_start();
    include(__dir__.DS.'views'.DS.'test.php');
    $output = ob_get_clean();
    echo $output;
    
  • Thanks

    And with SetData() ? Possible ?

  • Set the delivery type to view and use PHPs output buffering. E.g.:

    $sender->DeliveryType(DELIVERY_TYPE_VIEW);
    ob_start();
    $sender->Render($this->GetView('test.php'));
    $string = ob_get_flush();
    
  • Thanks OneMore,
    Bat the Base_Render_Before run 2 once

    TiA

  • gnem40gnem40 New
    edited January 2016
    $sender->DeliveryType(DELIVERY_TYPE_VIEW);
    ob_start();
    $sender->Render($this->GetView('test.php'));
    $string = ob_get_flush();
    

    Sender->DeliveryType(DELIVERY_TYPE_ALL);

    works like this, but the menu is created double, the menu items are all double.
    can someone faced such problem.

    thanks in advance

    p.s i spеак German better.

Sign In or Register to comment.