Problem I am having is that making a new component I cannot seem to get joomla to read the default layout file. This is happening in both the admin and site side of the component. Comparing it to another component I have created that works I can see no logical reason for it as both components work in the same environment.
I know that since the site and admin use the same methods, fixing it in one should fix it in the other. So here is the site side of things.
first the 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);
}
}
?>
Then the tmpl/default.php
<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted Access');
// load tooltip behavior
JHtml::_('behavior.tooltip');
?>
hello
As you can see it is barebones still, but when ever I try to access it on the site or admin it will say "500: Layout default not found".
I have spent over n hour now trying to find out where I went wrong that might of caused this.
Although I doubt it will matter here is the model/controller/constructor
component.php (named differently then actual component)
<?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();
?>
models/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{
}
?>
I may be blind and missing something, but with the amount of time I spent so far attempting minor tweaks it seems that restarting from scratch might be a less time consuming approach.
Also another note the component is not named "component" but I used it to make this example more readable.
EDIT:
Found out the reason, it is because I used the word review in the name of the component. Doing that tricks joomla's view methods and causes the error. (I changed the name of the component for the purpose of this without thinking that it may cause that)