コード例 #1
0
 public function addPaths($paths)
 {
     // Get views specified in herbert.
     $namespaces = Helper::get('views');
     foreach ($namespaces as $namespace => $views) {
         foreach ((array) $views as $view) {
             // Add to timber $paths array.
             array_unshift($paths, $view);
         }
     }
     return $paths;
 }
コード例 #2
0
 public function inline_css()
 {
     /*
      * @AgreableQuizPlugin is a Twig namespace which Herbert generates from
      * values in herbert.config.php.
      * @see http://twig.sensiolabs.org/doc/api.html#loaders
      *
      * Using get_field() which is an ACF function to retrieve theme
      * specific options affecting the style of the quiz.
      * ACF definitions for Panel are in app/panels.php.
      */
     $ns = Helper::get('agreable_namespace');
     echo view('@AgreableQuizPlugin/styles.twig', ['common_css_path' => Helper::asset('styles.css'), 'button_bg_colour' => get_field($ns . '_button_bg_colour', 'option'), 'button_bg_colour_hover' => get_field($ns . '_button_bg_colour_hover', 'option'), 'button_text_colour' => get_field($ns . '_button_text_colour', 'option'), 'button_text_colour_hover' => get_field($ns . '_button_text_colour_hover', 'option'), 'share_bg_colour' => get_field($ns . '_share_bg_colour', 'option'), 'primary_font_family' => get_field($ns . '_primary_font_family', 'option'), 'secondary_font_family' => get_field($ns . '_secondary_font_family', 'option'), 'plugin_settings_free_text' => get_field($ns . '_plugin_settings_free_text_css', 'option')])->getBody();
 }