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


PHP Functions::dump方法代码示例

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


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

示例1: discover

 /**
  * Discovers all the annotations of a given class file
  *
  * @param string             $class a class file
  * @return array
  */
 public static function discover($class)
 {
     try {
         if (!file_exists($class)) {
             throw new Exception($class . " does not exist");
         }
         $text = file($class, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
         $annotations = array();
         $currentAnnotations = array();
         foreach ($text as $key => $line) {
             if (strpos($line, "* @annotation") !== false) {
                 $currentAnnotations[] = trim(str_replace("* @annotation", "", $line));
             } else {
                 $functionName = "";
                 if (count($currentAnnotations) > 0 && Annotation::discoverFunctionName($line, $functionName)) {
                     $annotations[$functionName] = $currentAnnotations;
                     $currentAnnotations = array();
                 }
                 unset($text[$key]);
             }
         }
         return $annotations;
     } catch (Exception $e) {
         Functions::dump($e->getMessage());
         return NULL;
     }
 }
开发者ID:Romayne,项目名称:MVC-MVVM-Annotations-Framework,代码行数:33,代码来源:Annotation.class.php

示例2: renderPartialView

 /**
  * Renders the view body
  *
  * @param string             $location the location of the partial view
  * @param string             $file the actual view file
  * @return Mixed
  */
 public function renderPartialView($location, $file)
 {
     try {
         if (!file_exists("application/views/templates/" . $location . "/" . $file . ".php")) {
             throw new Exception($location . "/" . $file . ".php partial view does not exist");
         }
         include "application/views/templates/" . $location . "/" . $file . ".php";
     } catch (Exception $e) {
         if ($this->displayErrors) {
             Functions::dump($e->getMessage());
         }
         $this->displayErrors = false;
     }
 }
开发者ID:Romayne,项目名称:MVC-MVVM-Annotations-Framework,代码行数:21,代码来源:View.class.php

示例3: highlight_string

                </p>
                <p>
                    The <strong>php-label-for</strong>, <strong>php-input-for</strong>, and <strong>php-value-for</strong> rewrite the annotations provided by
                    the view model and changes them into valid HTML elements. Each tag helper accepts a value corresponding to the name of a property of the
                    view model.
                </p>
                <div class="highlight-php">
                    <?php 
highlight_string(file_get_contents("application/views/forms/Person/person.php"));
?>
                </div>
            </div>
            <div id="ExampleViewModelAnnotatedPost" class="col-md-12 example-panel hidden">
                <?php 
if (!empty($_POST)) {
    Functions::dump(Base::capture($_POST));
}
if (empty($_POST)) {
    ?>
                    <p>
                        Raw Post output only available after form has been submitted.
                    </p>
                <?php 
}
?>
            </div>
        </div>
    </div>
</div>

Generated on <?php 
开发者ID:Romayne,项目名称:MVC-MVVM-Annotations-Framework,代码行数:31,代码来源:_viewModelAnnotatedBinding.php

示例4: dispatch

 /**
  * Static method that dispatches a controller based on the provided controller and action name
  *
  * @param string             $controller the name of the controller without the trailing word Controller, e.g. Index as opposed to IndexController
  * @param string             $action the name of the action without the trailing word Action, e.g. index as opposed to indexAction
  * @return object
  */
 public static function dispatch($controller = "Index", $action = "index")
 {
     try {
         $controllerName = $controller . "Controller";
         $controllerLocation = FrontController::retrieveControllerFileLocation($controllerName);
         if (!file_exists($controllerLocation)) {
             throw new Exception($controllerName . ".class.php does not exist");
         }
         include $controllerLocation;
         eval("\$object = new " . $controllerName . "();");
         $object->__set("action", $action);
         $object->__set("controller", $controller);
         $object->__set("controllerName", $controllerName);
         $object->__set("url", FrontController::retrieveURL());
         $object->__set("method", FrontController::retrieveMethod());
         $object->__set("model", FrontController::retrieveModel($controller));
         $object->__set("view", new View($controller, $action));
         if (method_exists($object, "initialize")) {
             $annotationFactory = new AnnotationFactory($controllerLocation, "initialize");
             $object->initialize();
         }
         return $object;
     } catch (Exception $e) {
         Functions::dump($e->getMessage());
         return NULL;
     }
 }
开发者ID:Romayne,项目名称:MVC-MVVM-Annotations-Framework,代码行数:34,代码来源:FrontController.class.php


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