zoukankan      html  css  js  c++  java
  • fuelphp 问题1

    fuelphp遇到的一些小问题,写下来以防止别人遇到相同的问题,写的比较随意

    1.引用到ormmodel 报错:class Model_Test extends OrmModel

      报错内容:Class 'OrmModel' not found

      修正方法:fuel/app/config/config.php

    把以下代码放开

    'always_load'  => array(
             'packages'  => array(
                'orm',
            ),
         ),

    2.使用View_Smarty报错:View_Smarty::forge('XXXX')

      报错内容 Class 'View_Smarty' not found

      修正方法:

      fuel/app/config/config.php加入代码

    'always_load'  => array(
             'packages'  => array(
                'orm',
                'parser',
            ),
         ),    

      修正上面,继续报错:Class 'Smarty' not found

      修正方法:

      下载Smarty包放在fuel/app/vendor目录下,并且在fuel/packages/parser/config/parser.php文件中配置

    'View_Smarty'   => array(
            'include' => APPPATH.'vendor'.DS.'smarty'.DS.'smarty'.DS.'libs'.DS.'Smarty.class.php',
            'auto_encode'   => true,
            'delimiters'    => array('left' => '{', 'right' => '}'),
        ),

      详细内容要视具体目录结构配置

    3.controller写法

      目录结构 fuel/app/classes/controller/user/test.php

      1-class写法:class Controller_User_Test extends Controller_Template

      2-$template声明:public $template = 'test/test1/test2';    // 位置:fuel/app/views/test/test1/test2.php

        test2的后面省略.php 不然会报错

    4.定义constant类:获得其中定义的常量需要引用的时候,一般把它放在bootstrap.php中

      require APPPATH.'config/constant.php' ;

    5.DB定义文件

      

  • 相关阅读:
    shell 测试命令
    shell 键盘录入和运算
    shell 的变量
    shell 脚本 helloworld
    让windows系统的DOS窗口也可以显示utf8字符集
    wxpython发布还自己图标的程序
    弥补wxpython无背景图片缺陷
    wxPython实现在浏览器中打开链接
    使用py2exe发布windows平台Python
    python os模块实用函数
  • 原文地址:https://www.cnblogs.com/xiaoyezi/p/4172294.html
Copyright © 2011-2022 走看看