예제 #1
0
/**
 * Retrieve the name of the highest priority template file that exists.
 *
 * Searches in the STYLESHEETPATH before TEMPLATEPATH so that themes which
 * inherit from a parent theme can just overload one file.
 *
 * @since 1.0.0
 * @param string|array $template_names Template file(s) to search for, in order.
 * @param bool $load If true the template file will be loaded if it is found.
 * @param bool $require_once Whether to require_once or require. Default true. Has no effect if $load is false.
 * @return string The template filename if one is located.
 */
function locate_template($template_names)
{
    //initializing
    $folders = add_view_path();
    $located = '';
    foreach ((array) $template_names as $template_name) {
        $view = files_find($folders, $template_name . ".php");
        $model = files_find($folders, "models" . DS . $template_name . ".php");
        if (!$view && !$model) {
            continue;
        }
        $located = $template_name;
        break;
    }
    return $located;
}
예제 #2
0
/**
 * Function is responsible for defining the default system pathes
 */
function system_pathes()
{
    add_view_path(get_theme_dir());
    add_view_path(INCLUDES . "views");
}
예제 #3
0
<?php

/**
 * @Author Jonathon byrd
 * @link http://www.5twentystudios.com
 * @Package Importing
 * @Since 1.0.0
 * @copyright  Copyright (C) 2011 5Twenty Studios
 * 
 */
defined('ABSPATH') or _die("Cannot access pages directly.");
/**
 * Template Management
 * 
 * Declaring this folder as a folder that template files can be
 * located within.
 */
add_view_path(dirname(__FILE__));
/**
 * Pemalink Management
 * 
 * Defining exactly what 
 */
Router::connect('/errors/:action', array('controller' => 'errors', 'plugin' => 'errors'));
/**
 * Stylesheets
 */
//register_stylesheet( plugin_url(__file__,'css/import.css') );