Question

I'm trying to create my first component for Joomla 2.5 but when try to execute get this error:

Error: 500 You may not be able to visit this page because of:

  • an out-of-date bookmark/favourite
  • a search engine that has an out-of-date listing for this site
  • a mistyped address
  • you have no access to this page
  • The requested resource was not found.
  • An error has occurred while processing your request.

View not found [name, type, prefix]: transportation, html, transportationView

What I've developed now is very basic and this is the controller under site/components/com_transportation/controllers/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 TransportationController extends JController {
}

And under site/components/com_transportation/views/view.html.php this:

<?php

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// import Joomla view library
jimport('joomla.application.component.view');

class TransportationViewTransportation extends JView {

// Overwriting JView display method
function display($tpl = null) {
    // Assign data to the view
    $this->msg = 'Hello World';

    // Display the view
    parent::display($tpl);
}

}

What I'm missing? What is wrong?

Was it helpful?

Solution

Your folder structure is incorrect. Your view file must be in site/components/com_transportation/views/transportation/view.html.php

OTHER TIPS

Try this ,

When you start developing a new component go through the tutorial deeply,Then start modifying the samples .

follow this url it will help you .Its for 1.5 but the things are same for 2.5. Only you have to mention version in the xml

<install type="component" version="1.5.0">

Also you will get a sample component download from this.

Download it and compare with your component then find the issue.

Hope this may helps..

View not found [name, type, prefix]: transportation, html, transportationView

Means just tha no view was found with the class name of transporationViewtransporation and the type view.html.php. What is the name of the class in your view.html.php file? is the second transportation really lower case like that? Also what are the name(s) of your layout and xml files in the tmpl folder?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top