Saturday, May 22, 2010

500 - An error has occurred - joomla

Do u remember last time error? if not ple go here

"View not found [name, type, prefix]: lanka1s,html,lanka1sView" wt is this? this say, there is not 'view' page on this component. So today we can lean about 'how to make a view pages'

MVC or module view component, Now we are in view stage, For this we need new folder to store template files or view pages.

Ple make a new folder call "views" under that", again make a new folder call "lanka1s" and "view.html.php" file on there

see our folder structure
administrator->components->com_lanka1->views->lanka1s->view.html.php

see the content of "view.html.php"






<?php

/**
* Lanka1 default controller
*
* @package Joomla.component
* @subpackage Components
* @link http://inetlanka.com
* @license GNU/GPL
* @auth inetlanka web team - [ info@inetlanka.com / wapnishantha@gmail.com ]
*/

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

jimport( 'joomla.application.component.view' );

/**
* lanka1 View
*
* @package Joomla.component
* @subpackage Components
*/
class Lanka1sViewLanka1s extends JView
{
/**
* lanka1 view display method
* @return void
**/
function display($tpl = null)
{
JToolBarHelper::title( JText::_( 'Lanka1' ), 'generic.png' );
JToolBarHelper::deleteList();
JToolBarHelper::editListX();
JToolBarHelper::addNewX();




parent::display($tpl);
}
}




ooooop's he he ................ can u see there is another error


wt are the new things of this code
1.JToolBarHelper::title( JText::_( 'Lanka1' ), 'generic.png' );
this is use to set the TITLE of the page and can use existing image to take a handy look :D

2.JToolBarHelper::deleteList();
On this stage we do not need this but in future we need to delete items

3.JToolBarHelper::editListX();
On this stage we do not need this but in future we need to edit items

4. JToolBarHelper::addNewX()
On this stage we do not need this but in future we need to add items


ple connect with next lesson to solve above issue

wAp

No comments:

Post a Comment