dragon201401 2016-10-08 10:11
浏览 47

Phalcon呈现半页/渲染奇怪

What the page looks like

^What my page looks like.

For some reason I get this error

PHP Fatal error: Uncaught Error: Call to a member function getHash() on null in /var/www/html/coinpot/application/views/index/index.volt.php:146 Stack trace: #0 [internal function]: unknown() #1 [internal function]: Phalcon\Mvc\View\Engine\Volt->render('../application/...', Array, true) #2 [internal function]: Phalcon\Mvc\View->_engineRender(Array, 'index/index', true, true, NULL) #3 [internal function]: Phalcon\Mvc\View->render('index', 'index', Array) #4 /var/www/html/coinpot/public/index.php(158): Phalcon\Mvc\Application->handle() #5 {main} thrown in /var/www/html/coinpot/application/views/index/index.volt.php on line 146

when loading my page.

I also get a slew of others errors.

[Sat Oct 08 09:35:39.137966 2016] [:error] [pid 24670] [client ] PHP Notice:  Trying to get property of non-object in /var/www/html/coinpot/application/controllers/BaseController.php on line 37
[Sat Oct 08 09:35:39.143992 2016] [:error] [pid 24670] [client ] PHP Notice:  Undefined variable: pool in /var/www/html/coinpot/application/views/index/index.volt.php on line 101
[Sat Oct 08 09:35:39.144012 2016] [:error] [pid 24670] [client ] PHP Notice:  Trying to get property of non-object in /var/www/html/coinpot/application/views/index/index.volt.php on line 101
[Sat Oct 08 09:35:39.144037 2016] [:error] [pid 24670] [client ] PHP Notice:  Undefined variable: deposits in /var/www/html/coinpot/application/views/index/index.volt.php on line 134
[Sat Oct 08 09:35:39.144050 2016] [:error] [pid 24670] [client ] PHP Warning:  Invalid argument supplied for foreach() in /var/www/html/coinpot/application/views/index/index.volt.php on line 134
[Sat Oct 08 09:35:39.144070 2016] [:error] [pid 24670] [client ] PHP Notice:  Undefined variable: pool in /var/www/html/coinpot/application/views/index/index.volt.php on line 146

Lines 136-152 index.volt.php

    function decimalPlaces(float,length) {
        ret = "";
        str = float.toString();
        array = str.split(".");
        if(array.length==2) {
            ret += array[0] + ".";
            for(i=0;i<length;i++) {
                if(i>=array[1].length) ret += '0';
                else ret+= array[1][i];
            }
        } LINE 146
        else if(array.length == 1) {
            ret += array[0] + ".";
            for(i=0;i<length;i++) {
                ret += '0'
            }
        }
  • 写回答

1条回答 默认 最新

  • dongxia9519 2016-10-09 00:42
    关注

    I can't see index.volt.php so my guess is this.

    Add = NULL to the index.volt.php line 146 after the variable or variables for the getHash function in the () brackets.

    Also the notices show in localhost but not online. You can add error_reporting(E_ALL & ~E_NOTICE); or change it in php.ini to get rid of the notices. You don't have to fix notices.

    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题