Exemplo n.º 1
0
 /**
  * Fetch the content of a split test
  *
  * @param   mixed   $id   The campaign ID or slug
  * @return  string
  */
 public static function renderContent($id)
 {
     if ($campaign = Campaign::find($id)) {
         $twig = App::make('Cms\\Classes\\Controller')->getTwig();
         $twig->setLoader(new TwigStringLoader());
         return $twig->render($campaign->getTemplate(), ['splitSuccess' => 'data-splitter-id=' . $id]);
     }
 }
Exemplo n.º 2
0
 /**
  * Record a campaign conversion
  *
  * @return  void
  */
 public function onSuccess()
 {
     if ($campaign = Campaign::find(input('id'))) {
         $campaign->recordConversion();
     }
 }