Following error occur on last time article. Now we try to solve this issue ...............
"
Warning: require_once(C:\AppServ\www\Joomla\administrator\components\com_lanka1\controller.php) [function.require-once]: failed to open stream: No such file or directory in C:\AppServ\www\Joomla\administrator\components\com_lanka1\lanka1.php on line 17Fatal error: require_once() [function.require]: Failed opening required 'C:\AppServ\www\Joomla\administrator\components\com_lanka1\controller.php' (include_path='.;C:\php5\pear') in C:\AppServ\www\Joomla\administrator\components\com_lanka1\lanka1.php on line 17"
Wt is this error? Yes this is arising due to MVC. Base on MVC structure, our component automatically find "
controller.php" file. But at the moment it is not in our com_lanka1 folder.
we can use any name for this. But standard naming is important. see the code of "lanka1.php" can u see
"require_once( JPATH_COMPONENT.DS.'
controller.php' );"
code on their? Mmm ... this is the reason arrising above file not found issue.
Following code show the simple syntax of controller.php file
<?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.controller');
/**
* Lanka1 Component Controller
*
* @package Joomla.component
* @subpackage Components
*/
class Lanka1sController extends JController
{
/**
* Method to display the view
*
* @access public
*/
function display()
{
parent::display();
}
}
Can u guess the essential part of this code? Mmm ...........
yes it is "class Lanka1sController extends JController". Look wt is the text it use. "Lanka1sController" In this word, [ Did u remeber?our component name is com_
lanka1 ]. Here we take it as lanka1
s. must remember this "S" is very importent. And also our class extend to core joomla class through the "JController"
ok when after adding "
controller.php" to our testing component [administrator ->components->com_lanka1->
controller.php]. again visit following link, from joomla admin [
http://YOUR JOOMLA PATH/administrator/index.php?option=com_lanka1 ]

Is this the error? yes this is the error we face on this stage.
continue with next lesson
wAp