【问题标题】:Paths to differents files in one view - Joomla一个视图中不同文件的路径 - Joomla
【发布时间】:2017-12-11 22:26:01
【问题描述】:

我正在尝试将组件视图文件 (default.php) 中的链接放入同一视图 (default_formulaire.php) 中的另一个文件,如下所示:

但我真的不知道如何在 PHP 中访问它。 我知道default.php 文件的网址是:
index.php?option=com_multicontact&view=reclamation 但我不知道default_formulaire.php

感谢您的帮助:)

【问题讨论】:

    标签: php templates view joomla path


    【解决方案1】:

    Joomla 中任何视图的链接如下:

    index.php?option=com_componentname&view=viewname&layout=layoutname
    

    但是,如果 URL 中省略了 layout,则假定它被设置为 default。所以,以下网址:

    index.php?option=com_componentname&view=viewname
    

    表示布局为default,表示将加载default.php文件。

    因此,在您的情况下,加载 default_formulaire 布局的 URL 将是:

    index.php?option=com_multicontact&view=reclamation&view=default_formulaire
    

    【讨论】:

      【解决方案2】:

      如果您需要在 joomla 中访问不同的布局,那么您需要在 joomla url 中添加一个布局值,例如 index.php?option=com_multicontact&view=reclamation&layout=default_formulaire

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-09-07
        • 1970-01-01
        • 2019-01-27
        • 2011-07-10
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-03-21
        相关资源
        最近更新 更多