当前位置: 首页>>代码示例>>PHP>>正文


PHP APP::path方法代码示例

本文整理汇总了PHP中APP::path方法的典型用法代码示例。如果您正苦于以下问题:PHP APP::path方法的具体用法?PHP APP::path怎么用?PHP APP::path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在APP的用法示例。


在下文中一共展示了APP::path方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 function __construct()
 {
     parent::__construct();
     // Carga local de modelos
     if (isset($this->components) and is_array($this->components)) {
         foreach ($this->components as $component) {
             $local = APP::path('Controllers', array('Components')) . ucfirst(strtolower($component)) . 'Component.php';
             if (file_exists($local)) {
                 $this->load($component, 'Controllers', array('Components'), 'Component');
             } else {
                 $this->load($component, 'Lib', array('Controller', 'Components'), 'Component');
             }
         }
     }
 }
开发者ID:Bincat,项目名称:MVC,代码行数:15,代码来源:Component.inc.php

示例2: __construct

 /**
  * Constructor
  *
  * Carga los modelos y plugins de un controlador.
  * 
  * @author Adrián Méndez <bin.cat.service@gmail.com>
  * @version 2.0
  * */
 public function __construct()
 {
     // Carga local de sesión
     $this->load('Session', 'Lib');
     // Carga local de modelos
     if (isset($this->models) and is_array($this->models)) {
         foreach ($this->models as $model) {
             $local = APP::path('Models') . ucfirst(strtolower($model)) . 'Model.php';
             if (file_exists($local)) {
                 $this->load($model, 'Models', array(), 'Model');
             } else {
                 $this->load($model, 'Lib', array('Model'), 'Model');
             }
         }
     }
     // Carga local de plugins
     if (is_array($this->plugins) and !empty($this->plugins)) {
         foreach ($this->plugins as $plugin) {
             $local = APP::path('Plugins', ucfirst(strtolower($plugin))) . ucfirst(strtolower($plugin)) . 'Plugin.php';
             $this->load(ucfirst(strtolower($plugin)), 'Plugins', array(ucfirst(strtolower($plugin))), 'Plugin');
         }
     }
 }
开发者ID:Bincat,项目名称:MVC,代码行数:31,代码来源:Controller.inc.php

示例3: load

 /**
  * Load
  *
  *  Crea un objeto y clase definidas.
  *
  * El primer parámetro es obligatorio y debe ser el nombre del archivo Inc, y
  * coincidir
  * con el nombre de la clase, por ejemplo "Session.inc.php" y la clase "Session".
  *
  * El segundo parámetro es opcional y corresponde a la ubicación, por defecto
  * será raíz, done
  * se estima que deban ir todos los plugins que puedan ser accedidos por
  * controlador, modelos y vistas, como
  * el caso de sesion.
  *
  * @author Adrián Méndez <bin.cat.service@gmail.com>
  * @version 1.0
  * */
 public function load($class_name, $class_loc = null, $subs = null, $prefix = '.inc')
 {
     $object_name = ucfirst(strtolower($class_name));
     $filename = APP::path($class_loc, $subs) . $class_name . $prefix . ".php";
     if (file_exists($filename)) {
         include_once $filename;
         if ($prefix != '.inc') {
             $class_name .= ucfirst(strtolower($prefix));
         }
         if (class_exists($class_name)) {
             $this->{$object_name} = new $class_name();
         } else {
             die(sprintf('Library Found but Class names is missmatch! [%s]', $class_name));
         }
     } else {
         die(sprintf('Library Not Found! [%s]', $filename));
     }
 }
开发者ID:Bincat,项目名称:MVC,代码行数:36,代码来源:Commons.inc.php

示例4: foreach

<?php

/**
 * The url of the persona script tag.
 * It must be included on every page which uses navigator.id functions.
 * Because Persona is still in development, it shouldn't be localy cached.
 */
if (!Configure::read('Persona.scriptUrl')) {
    Configure::write('Persona.scriptUrl', 'https://login.persona.org/include.js');
}
/**
 * URL of the service that's going to verify the indentity assertion
 */
if (!Configure::read('Persona.endpointUrl')) {
    Configure::write('Persona.endpointUrl', 'https://verifier.login.persona.org/verify');
}
/**
 * Bundle of CA Root Certificates from Mozilla for usage with cURL
 *
 * @link http://curl.haxx.se/docs/caextract.html
 */
if (!Configure::read('Persona.sslCertPath')) {
    Configure::write('Persona.sslCertPath', false);
    $vendorPaths = APP::path('Vendor', 'Persona');
    foreach ($vendorPaths as $path) {
        if (file_exists($path . 'cacert.pem')) {
            Configure::write('Persona.sslCertPath', $path . 'cacert.pem');
        }
    }
}
开发者ID:markomarkovic,项目名称:cakephp-plugin-persona,代码行数:30,代码来源:bootstrap.php

示例5: build_element

 public static function build_element($element, $aParams = array())
 {
     foreach ($aParams as $name => $data) {
         ${$name} = $data;
     }
     include APP::path('Views') . 'Elements/' . $element . ".ctp";
 }
开发者ID:Bincat,项目名称:MVC,代码行数:7,代码来源:View.inc.php

示例6: loadBehaviors

 /**
  * Load Behaviors
  *
  * Carga los comportamientos incluidos en un modelo en especìfico.
  *
  * Ahora carga directamente desde los behaviors locales.
  *
  * @author Adrián Méndez <bin.cat.service@gmail.com>
  * @Version 1.1
  */
 protected function loadBehaviors()
 {
     if (isset($this->behaviors) and is_array($this->behaviors)) {
         foreach ($this->behaviors as $behaviors) {
             $local = APP::path('Models', array('Behaviors')) . ucfirst(strtolower($behaviors)) . 'Behavior.php';
             if (file_exists($local)) {
                 $this->load($behaviors, 'Models', array('Behaviors'), 'Behavior');
             } else {
                 $this->load($behaviors, 'Lib', array('Model', 'Behaviors'), 'Behavior');
             }
         }
     }
 }
开发者ID:Bincat,项目名称:MVC,代码行数:23,代码来源:Model.inc.php

示例7: _controller_enviroment

 private function _controller_enviroment()
 {
     // Carga de controlador primario
     $this->{$this->controller}->data = $this->data;
     $this->{$this->controller}->template = self::$defaults['template'];
     $this->{$this->controller}->view = $this->action;
     $this->{$this->controller}->action = $this->action;
     $this->{$this->controller}->controller = $this->controller;
     $this->{$this->controller}->request = $this->request;
     $this->{$this->controller}->get = $this->getAttrs;
     // Revisa si hay que cargar componentes
     if (isset($this->{$this->controller}->components)) {
         if (!is_array($this->{$this->controller}->components)) {
             die('$components debe ser un array');
         }
         foreach ($this->{$this->controller}->components as $c) {
             if (!is_null(self::$context)) {
                 $local = APP::path('Controllers', array(ucfirst(strtolower(self::$context)), 'Components')) . ucfirst(strtolower($c)) . 'Component.php';
             } else {
                 $local = APP::path('Controllers', array('Components')) . ucfirst(strtolower($c)) . 'Component.php';
             }
             if (file_exists($local)) {
                 if (!is_null(self::$context)) {
                     $this->{$this->controller}->load($c, 'Controllers', array(ucfirst(strtolower(self::$context)), 'Components'), 'Component');
                 } else {
                     $this->{$this->controller}->load($c, 'Controllers', array('Components'), 'Component');
                 }
             } else {
                 $this->{$this->controller}->load($c, 'Lib', array('Controller', 'Components'), 'Component');
             }
             // PASA A LOS COMPONENTES EL CONTEXTO COMUN DE UN CONTROLADOR
             $this->{$this->controller}->{$c}->data = $this->data;
             $this->{$this->controller}->{$c}->template = self::$defaults['template'];
             $this->{$this->controller}->{$c}->view = $this->action;
             $this->{$this->controller}->{$c}->action = $this->action;
             $this->{$this->controller}->{$c}->controller = $this->controller;
             $this->{$this->controller}->{$c}->request = $this->request;
             $this->{$this->controller}->{$c}->get = $this->getAttrs;
         }
     }
 }
开发者ID:Bincat,项目名称:MVC,代码行数:41,代码来源:APP.inc.php


注:本文中的APP::path方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。