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 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?