문제 새로운 구성 요소를 만드는 중 기본 레이아웃 파일을 읽는 데 joomla를 사용할 수없는 것 같습니다. 이 문제는 구성 요소의 관리자 측과 사이트 측 모두에서 발생합니다. 그것을 내가 만든 다른 구성 요소와 비교하면 두 구성 요소가 동일한 환경에서 작동하므로 논리적 인 이유가 없습니다.줌라! 2.5 기본 레이아웃을 읽지 않습니다
나는 사이트와 관리자가 동일한 방법을 사용하기 때문에 하나를 고치는 것이 다른 방법으로 고쳐야한다는 것을 알고있다. 여기 사이트의 측면이 있습니다. view.html.php 그런
<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla view library
jimport('joomla.application.component.view');
class ComponentViewComponent extends JView{
function display($tpl = null){
parent::display($tpl);
}
}
?>
먼저 tmpl/default.php
<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted Access');
// load tooltip behavior
JHtml::_('behavior.tooltip');
?>
hello
당신은 여전히 베어 본, 그러나 볼 수 있듯이 나는에 액세스하려고 그 어느 때 사이트 또는 관리자는 "500 : 레이아웃 기본값을 찾을 수 없습니다"라고 말합니다.
나는 지금 내가 잘못한 곳을 찾아 내려고 노력하면서 n 시간을 보냈다.
내가 여기에 문제가 의심하지만 모델/컨트롤러/생성자를 (다른 후 실제 구성 요소 이름)
component.php입니다
<?php
//No direct access to this file
defined('_JEXEC') or die ('Restricted access');
// import joomla controller library
jimport('joomla.application.component.controller');
// Get an instance of the controller prefixed by GoTireReviews
$controller = JController::getInstance('Component');
// Perform the Request task
$input = JFactory::getApplication()->input;
$controller->execute($input->getCmd('task'));
// Redirect if set by the controller
$controller->redirect();
?>
모델/component.php
<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla modelitem library
jimport('joomla.application.component.modelitem');
class ComponentModelComponent extends JModelItem{
}
?>
controller.php
<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controller library
jimport('joomla.application.component.controller');
class ComponentController extends JController{
}
?>
나는 눈이 멀고 뭔가 빠졌지 만, 지금까지 약간의 조작을 시도한 시간은 처음부터 다시 시작하는 것이 시간이 많이 걸리지 않는 접근 방식 일 수 있습니다.
또한 구성 요소의 이름이 "구성 요소"가 아니지만이 예제를보다 쉽게 읽을 수 있도록 사용했습니다.
편집 :
, 원인을 찾을 내가 구성 요소의 이름으로 단어 검토를 사용 때문입니다. 그렇게하면 joomla의 뷰 메소드가 작동하여 오류가 발생합니다. (이 문제를 일으킬 수 있다고 생각하지 않고이 목적을 위해 구성 요소의 이름을 변경했습니다.)