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


PHP Backend::getContent方法代码示例

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


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

示例1: hook_output

 public static function hook_output($to_print)
 {
     //Construct the object to output
     $object = new StdClass();
     $object->result = $to_print;
     $object->error = Backend::getError();
     $object->notice = Backend::getNotice();
     $object->success = Backend::getSuccess();
     $object->content = Backend::getContent();
     $last = '';
     while (ob_get_level() > self::$ob_level) {
         //Ending the ob_start from __construct
         $last .= ob_get_clean();
     }
     $object->output = $last;
     //Clean up
     Backend::setError();
     Backend::setNotice();
     Backend::setSuccess();
     //Return the XML
     $options = array(XML_SERIALIZER_OPTION_INDENT => "\t", XML_SERIALIZER_OPTION_RETURN_RESULT => true, XML_SERIALIZER_OPTION_DEFAULT_TAG => 'item', XML_SERIALIZER_OPTION_XML_DECL_ENABLED => true, XML_SERIALIZER_OPTION_XML_ENCODING => Controller::$view->charset, XML_SERIALIZER_OPTION_ROOT_NAME => 'XmlResult', XML_SERIALIZER_OPTION_TYPEHINTS => true);
     $serializer = new XML_Serializer($options);
     if ($result = @$serializer->serialize($object)) {
         return $result;
     } else {
         return null;
     }
 }
开发者ID:jrgns,项目名称:backend-php,代码行数:28,代码来源:XmlView.obj.php

示例2: hook_output

 public static function hook_output($to_print)
 {
     Backend::add('BackendErrors', Backend::getError());
     Backend::add('BackendSuccess', Backend::getSuccess());
     Backend::add('BackendNotices', Backend::getNotice());
     Backend::add('BackendInfo', Backend::getInfo());
     Backend::setError();
     Backend::setSuccess();
     Backend::setNotice();
     Backend::setInfo();
     $content = Backend::getContent();
     if (empty($content)) {
         ob_start();
         var_dump($to_print);
         $content = ob_get_clean();
         if (substr($content, 0, 4) != '<pre') {
             $content = '<pre>' . $content . '</pre>';
         }
         Backend::addContent($content);
     }
     $layout = Backend::get('HTMLLayout', 'index');
     if (!Render::checkTemplateFile($layout . '.tpl.php')) {
         if (SITE_STATE != 'production') {
             Backend::addError('Missing Layout ' . $layout);
         }
         $layout = 'index';
     }
     $to_print = Render::file($layout . '.tpl.php');
     $to_print = self::addLastContent($to_print);
     $to_print = self::replace($to_print);
     $to_print = self::rewriteLinks($to_print);
     $to_print = self::addLinks($to_print);
     $to_print = self::formsAcceptCharset($to_print);
     //TODO fix this
     if (Component::isActive('BackendFilter')) {
         $BEFilter = new BEFilterObj();
         $BEFilter->read();
         $filters = $BEFilter->list ? $BEFilter->list : array();
         foreach ($filters as $row) {
             if (class_exists($row['class'], true) && is_callable(array($row['class'], $row['function']))) {
                 $to_print = call_user_func(array($row['class'], $row['function']), $to_print);
             }
         }
     }
     //TODO Make this configurable
     if (ConfigValue::get('html_view.TidyHTML') && function_exists('tidy_repair_string')) {
         $to_print = tidy_repair_string($to_print);
     }
     return $to_print;
 }
开发者ID:jrgns,项目名称:backend-php,代码行数:50,代码来源:HtmlView.obj.php

示例3: hook_output

 public static function hook_output($to_print)
 {
     Backend::add('BackendErrors', Backend::getError());
     Backend::add('BackendSuccess', Backend::getSuccess());
     Backend::add('BackendNotices', Backend::getNotice());
     Backend::add('BackendInfo', Backend::getInfo());
     Backend::setError();
     Backend::setSuccess();
     Backend::setNotice();
     Backend::setInfo();
     $content = Backend::getContent();
     if (empty($content)) {
         ob_start();
         var_dump($to_print);
         $content = ob_get_clean();
         if (substr($content, 0, 4) != '<pre') {
             $content = '<pre>' . $content . '</pre>';
         }
         Backend::addContent($content);
     }
     $to_print = Render::renderFile('styles.area.tpl.php');
     $to_print .= Render::renderFile('maincontent.tpl.php');
     $to_print .= Render::renderFile('scripts.tpl.php');
     $to_print = HtmlView::addLastContent($to_print);
     $to_print = HtmlView::replace($to_print);
     $to_print = HtmlView::rewriteLinks($to_print);
     $to_print = HtmlView::addLinks($to_print);
     $to_print = HtmlView::formsAcceptCharset($to_print);
     if (Component::isActive('BackendFilter')) {
         $BEFilter = new BEFilterObj();
         $BEFilter->read();
         $filters = $BEFilter->list ? $BEFilter->list : array();
         foreach ($filters as $row) {
             if (class_exists($row['class'], true) && is_callable(array($row['class'], $row['function']))) {
                 $to_print = call_user_func(array($row['class'], $row['function']), $to_print);
             }
         }
     }
     return $to_print;
 }
开发者ID:jrgns,项目名称:backend-php,代码行数:40,代码来源:ChunkView.obj.php

示例4: hook_output

 public static function hook_output($to_print)
 {
     //Construct the object to output
     $object = new stdClass();
     $object->result = $to_print;
     $object->error = Backend::getError();
     $object->notice = Backend::getNotice();
     $object->success = Backend::getSuccess();
     $object->info = Backend::getInfo();
     $object->content = Backend::getContent();
     $last = '';
     while (ob_get_level() > self::$ob_level) {
         //Ending the ob_start from __construct
         $last .= ob_get_clean();
     }
     $object->output = $last;
     //Clean up
     Backend::setError();
     Backend::setNotice();
     Backend::setSuccess();
     Backend::setInfo();
     //$result_only = Controller::getVar('result_only');
     return json_encode($object);
 }
开发者ID:jrgns,项目名称:backend-php,代码行数:24,代码来源:JsonView.obj.php

示例5: array_filter

<?php

$contents = array_filter(array_map('trim', Backend::getContent()));
if (!empty($contents)) {
    ?>
	<?php 
    foreach ($contents as $content) {
        ?>
		<?php 
        echo $content;
        ?>
	<?php 
    }
} else {
    ?>
	<div>&nbsp;</div>
<?php 
}
开发者ID:jrgns,项目名称:backend-php,代码行数:18,代码来源:maincontent.tpl.php

示例6: hook_output

 public static function hook_output($to_print)
 {
     $content = Backend::getContent();
     $to_print .= PHP_EOL . implode(PHP_EOL, $content);
     return $to_print;
 }
开发者ID:jrgns,项目名称:backend-php,代码行数:6,代码来源:CssView.obj.php


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