dongyou6909 2014-10-12 13:46
浏览 274
已采纳

Fat Free Framework更改$ f3变量名称

For those who know FatFree Framework, you are used to see this variable $f3. I want to change it to some other name more intuitive like $this or $app, and although I know that it's possible, what are the counter parts of doing that?

For example, this code:

<?php

$f3=require('lib/base.php');

$f3->set('DEBUG',1);
if ((float)PCRE_VERSION<7.9)
    trigger_error('PCRE version is out of date');

$f3->config('config.ini');

Would be:

<?php

$app=require('lib/base.php');

$app->set('DEBUG',1);
if ((float)PCRE_VERSION<7.9)
    trigger_error('PCRE version is out of date');

$app->config('config.ini');
  • 写回答

1条回答 默认 最新

  • duanmie9682 2014-10-13 06:36
    关注

    There's absolutely no counterpart of doing so. Here, $f3 is a local PHP variable, which can be renamed to whatever you like, as long as you follow the usual rules for PHP variables.

    Especially, PHP won't allow you to rename it to $this, which is a reserved keyword.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)