解决方案 »

  1.   

    index.php  内容是:
    <?php
    //缓存路径
    defined('THINK_PATH',"./Lib/ThinkPHP/"); 
    define('RUNTIME_PATH','./Runtime/');
    define('APP_NAME','helloword');
    define('APP_PATH','./Lib/');
    define('APP_DEBUG',True);
    require './Lib/ThinkPHP/ThinkPHP.php';
    ?>
      

  2.   

    在就在Lib下面放了ThinkPHP .其他全是自动生成的
      

  3.   


    这个是官方的目录结构。我只不过是将 Application改成 Lib了。
      

  4.   

    你是怎么调用?common.phpfunction test(){
        retrun 'hello world';
    }
    TestAction.class.phpclass TestAction extends Action{
        function index(){
            var_dump(test());
        }
    }调用 http://localhost/Test/index
      

  5.   

    View/Index/index.html  的内容是:
    fafafa
    <br>
    <?php
    echo nima();
    ?>
      

  6.   

    模板调用{:nima()}类似在模板调用,格式化时间一样
    {:date('Y-m-d')}
      

  7.   

    我将common.php 改成function.php 就好了。。不是说是common么。
      

  8.   

    View/Index/index.html 的内容是:
    fafafa
    <br>
    {:nima();}
    <?php
    echo nima();
    ?>
    页面返回是:
      

  9.   

    一直是function.php。文件夹叫common而已
      

  10.   

    3.2版本改了,改成function.php,之前是Common.php
      

  11.   

    我是这么做的,仅供参考1.目录结构
    2.config.php中加上一行代码
    // 加上自定义函数库
    'LOAD_EXT_FILE' => $funcs,注意:我是把COMMON目录放在根目录下了,在根目录下的index.php中加了一行
    // 定义公共模块的目录,放到应用目录外
    define ( 'COMMON_PATH', './Common/' );愿对您有所帮助