作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
如果 JRequest::getCmd
deprecate!!
function propios(){
$model = &$this->getModel(JRequest::getCmd('view'));
$view = &$this->getView(JRequest::getCmd('view'), 'html');
$view->setModel($model, true);
$view->hardwarePropio();
}
任何想法!
最后是我的控制
class HardwareController extends JController
{
// busca los hardwares propios
function propios(){
$jinput = JFactory::getApplication()->input;
$view = $jinput->getCmd('view', 'hardwares');
JFactory::getApplication()->input->set('view', $view);
$model = &$this->getModel($view);
$view = &$this->getView($view, 'html');
$view->setModel($model, true);
$view->$view->hardwarePropio();
}
$view = JFactory::getApplication()->input->getCmd('view', 'hardwares');
JFactory::getApplication()->input->set('view', $view);
如果我删除最后两行, View 中调用函数的链接将不起作用
<a href="<?php echo JURI::root()?>index.php/hardware/propios">Equipos propios</a>
如何调用函数hardwarePropio()
最佳答案
而不是这个-
$model = &$this->getModel(JRequest::getCmd('view'));
$view = &$this->getView(JRequest::getCmd('view'), 'html');
$view->setModel($model, true);
$view->hardwarePropio();
你可以用这个-
$jinput = JFactory::getApplication()->input;
$view = $jinput->getCmd('view', 'hardwares');
$model = &$this->getModel($view);
$view = &$this->getView($view,'html');
$view->setModel($model, true);
$view->hardwarePropio();
API - http://doc.joomladev.eu/api25/Joomla-Platform/Application/JInput.html
关于joomla - JRequest::getCmd 弃用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14499810/
如果 JRequest::getCmd deprecate!! 我没有在文档中找到 How to modified this in joomla 2.5 function propios(){
如果 JRequest::getCmd deprecate!! 我没有在文档中找到 How to modified this in joomla 2.5 function propios(){
我是一名优秀的程序员,十分优秀!