如何在没有模板的情况下显示视图?
我在自己的组件(view.html.php)中具有视图(前端):
I have view (frontend) in my own component (view.html.php):
class MevViewMev extends JView{
function display($tpl = null){
parent::display($tpl);
}
}
和模板:
<?php defined('_JEXEC') or die('Restricted access'); ?>
<div>
ASFADSFDSF
</div>
如何在没有joomla模板的情况下显示它(头部,样式等).我想在窗口中调用jquery onclick方法的这一部分.
How to display it without joomla template (head section, styles, etc). I want to call this part of jquery onclick method in the window.
要显示组件,只需在URL中添加"tmpl = component"参数. 如果需要显示除组件视图之外的内容,则可以对其进行自定义-在模板的根文件夹中创建"component.php"文件,并在其中包含所需的任何内容. 可以用相同的方式完成更多模板-在模板的根文件夹中创建"some_template.php",然后在网址中添加"tmpl = some_template"参数.
To display the component only add "tmpl=component" parameter to url. If need to display something besides component's view it can be customized - create "component.php" file in template's root folder and include in it whatever you need. More templates can be done in the same way - create "some_template.php" in template's root folder and add "tmpl=some_template" parameter to url.