This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
osarzola
Hello i am trying to to something like this..
<?php
class Build extends Controller
{
public function onSelectPartial()
{
$theme = Theme::load('base');
$partial = CmsCompoundObject::load($theme,'partials/sliders/Slider-normal--c8.htm');
$partial->markup; // i got the raw markup how can i compile that Partial that has Twig?
}
}
osarzola
If anyone is interested this is a little workaround
This parse a partial inside the themes/partials with twig in the backend Controller
<?php
$elem = \Input::get('partial');
$theme = Theme::load('base');
$partial = CmsCompoundObject::load($theme,"partials/$elem");
$this->markupPreview = $partial->markup;
$twig = App::make('twig.environment');
$c = new MainController($theme);
$twig->addExtension(new CmsTwigExtension($c));
$twig->addExtension(new SystemTwigExtension($c));
$html = Twig::parse($this->markupPreview,['pages'=>[['title'=>'Hepou'],['title'=>'Hpos']]]);
return $this->makePartial('modal',['content'=>$html]);
1-2 of 2