PluginProbe ʕ •ᴥ•ʔ
ShareThis Dashboard for Google Analytics / 2.5.3
ShareThis Dashboard for Google Analytics v2.5.3
3.3.2 trunk 1.0.7 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2.5 2.3.5 2.3.6 2.3.7 2.3.8 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 3.0.0 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.3.0 3.3.1
googleanalytics / class / core / Ga_View_Core.php
googleanalytics / class / core Last commit date
Ga_Controller_Core.php 6 years ago Ga_View_Core.php 5 years ago
Ga_View_Core.php
37 lines
1 <?php
2
3 class Ga_View_Core {
4
5 /**
6 * Name of the view folder.
7 */
8 const PATH = 'view';
9
10 /**
11 * Loads given view file and it's data.
12 * Displays view or returns HTML code.
13 *
14 * @param string $view Filename
15 * @param array $data Data array
16 * @param bool $html Whether to display or return HTML code.
17 *
18 * @return string
19 */
20 public static function load( $view, $data_array = array(), $html = false ) {
21 if ( !empty( $view ) ) {
22 foreach ( $data_array as $k => $v ) {
23 $$k = $v;
24 }
25
26 ob_start();
27 include GA_PLUGIN_DIR . "/" . self::PATH . "/" . $view . ".php";
28 if ( $html ) {
29 return ob_get_clean();
30 } else {
31 echo ob_get_clean();
32 }
33 }
34 }
35
36 }
37