dpauxqt1281 2014-12-22 05:55
浏览 86
已采纳

在joomla中找到php文件引用

what does $this variable in my edit.php file mean? there is no "include" or "require" in other files! I mean how can I find the class that $this is pointing. where is the main php file that contains classes which are using this edit.php file

edit.php

 <?php
/**
* @package RSForm! Pro
* @copyright (C) 2007-2014 www.rsjoomla.com
* @license GPL, http://www.gnu.org/copyleft/gpl.html
*/

defined('_JEXEC') or die('Restricted access'); 

JHtml::_('behavior.keepalive');
?>

<script type="text/javascript">
function directorySave(task) {
    var form = document.getElementById('directoryEditForm');
    form.task.value = task;
    form.submit();
}
</script>

<form action="<?php echo JRoute::_('index.php?     option=com_rsform&view=directory&layout=edit&id='.$this->app->input->getInt('id',0)); ?>"     method="post" name="adminForm" id="directoryEditForm" enctype="multipart/form-data">
    <table class="table table-condensed table-striped table-hover table-bordered category">
        <?php foreach ($this->fields as $field) { ?>
        <tr>
            <td width="200" style="width: 200px;">
            <?php echo $field[0]; ?> <?php echo $field[2]; ?>
        </td>
        <td>
            <?php echo $field[1]; ?>
        </td>
    </tr>
    <?php } ?>
   </table>

<div class="form-actions">
    <button type="button" onclick="directorySave('apply');" class="btn btn-primary button"><?php    echo JText::_('RSFP_SUBM_DIR_APPLY'); ?></button> 
    <button type="button" onclick="directorySave('save');" class="btn btn-primary button"><?php    echo JText::_('RSFP_SUBM_DIR_SAVE'); ?></button> 
    <button type="button" onclick="directorySave('back')" class="btn button"><?php echo     JText::_('RSFP_SUBM_DIR_BACK'); ?></button>
    <?php       /* <--! I am Ahmad Mobaraki     --> */?>
    <button type="button" onclick="directorySave('delete')" class="btn btn-primary button"><?php echo JText::_('RSFP_SUBM_DIR_DELETE'); ?></button>
    <?php      /*  end ahmad*/ ?>

</div>

<input type="hidden" name="option" value="com_rsform">
<input type="hidden" name="controller" value="directory">
<input type="hidden" name="task" value="">
<input type="hidden" name="id" value="<?php echo $this->app->input->getInt('id',0); ?>">
<input type="hidden" name="formId" value="<?php echo $this->params->get('formId'); ?>">
</form>
  • 写回答

1条回答 默认 最新

  • douzi2749 2014-12-22 06:16
    关注

    if its in the tmpl folder of a view folder it refers to a JView/JViewLegacy/JViewBase class or whatever you extended your view class to be. Usually that class will be defined in the parent folder in view.html.php or similarly named file.

    If you do a var_dump of $this it will tell you the class name

    For instance if I do

    var_dump($this); die;
    

    in one of my view template files i get

    object(VeteransViewVeterans)#190.....

    Where VeteransViewVeterans is my view class for my Veterans view of my Veterans component.

    $this holds the view class reference because its the class that includes/requires it

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

报告相同问题?

悬赏问题

  • ¥15 java大作业爬取网页
  • ¥15 怎么获取欧易的btc永续合约和交割合约的5m级的历史数据用来回测套利策略?
  • ¥15 有没有办法利用libusb读取usb设备数据
  • ¥15 为什么openeluer里面按不了python3呢?
  • ¥15 关于#matlab#的问题:训练序列与输入层维度不一样
  • ¥15 关于Ubuntu20.04.3LTS遇到的问题:在安装完CUDA驱动后,电脑会进入卡死的情况,但可以通过键盘按键进入安全重启,但重启完又会进入该情况!
  • ¥15 关于#嵌入式硬件#的问题:树莓派第一天重装配置python和opencv后第二天打开就成这样,瞎捣鼓搞出来文件夹还是没把原来的界面调回来
  • ¥20 Arduino 循迹小车程序电路出错故障求解
  • ¥20 Arduino 循迹小车程序电路出错故障求解
  • ¥15 C++数组中找第二小的数字程序纠错