/
index.php
42 lines (34 loc) · 926 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/*
Plugin Name: Slab — View
Plugin URI: http://www.wp-slab.com/components/view
Description: The Slab View component. Create views from templates and files.
Version: 1.0.0
Author: Slab
Author URI: http://www.wp-slab.com
Created: 2015-08-08
Updated: 2015-08-08
Repo URI: github.com/wp-slab/slab-view
Requires: slab-core
*/
// Define
define('SLAB_VIEW_INIT', true);
define('SLAB_VIEW_DIR', plugin_dir_path(__FILE__));
define('SLAB_VIEW_URL', plugin_dir_url(__FILE__));
// Includes
include SLAB_VIEW_DIR . 'functions.php';
// Hooks
add_action('slab_init', 'Slab\View\slab_view_init');
add_action('slab_view_directories', 'Slab\View\slab_view_default_locations');
/**
* Global view() method
*
* @param string View name
* @param array View data
* @return Slab\View\ViewInterface
**/
if(!function_exists('view')) {
function view($name, array $data = null) {
return slab('view')->make($name, $data);
}
}