The Joomla! Forum ™






Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Tue Jan 10, 2012 10:23 am 
Joomla! Fledgling
Joomla! Fledgling

Joined: Tue Jan 10, 2012 10:10 am
Posts: 1
i'm using http://docs.joomla.org/Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.6 to develop an extension, when i come to http://docs.joomla.org/Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!1.7_-_Part_06 part 6 i had a blanc page and the problem come from my site/models/library.php there is the code
Code:
<?php
   defined('_JEXEC') or die('Restricted access');
   jimport('joomla.application.component.modelitem');
   class LibraryModelLibrary extends JModelItem
   {
      protected $msg;
      public function getTable($type = 'Library', $prefix = 'LibraryTable', $config = array())
      {
         return JTable::getInstance($type, $prefix, $config);
      }
      public function getMsg()
      {
         if (!isset($this->msg))
         {
            $id = JRequest::getInt('id', 1);
            $table = $this->getTable();
            $table->load($id);
            $this->msg = $table->title;
         }
         return $this->msg;
      }
   }


i think problem come from $type = 'Library', $prefix = 'LibraryTable', my table name is ebook_livre, what should i mention us $type and $prefix ? or is there any other reasons ?


Top
 Profile  
 
PostPosted: Tue Jan 10, 2012 12:59 pm 
User avatar
Joomla! Virtuoso
Joomla! Virtuoso

Joined: Thu Feb 15, 2007 5:48 am
Posts: 3344
Location: Sydney, Australia
If you are developing in Joomla 1.6/1.7, the constructor of the class JTable in libraries/joomla/database/table.php accepts the following parameters:
Code:
    * @param   string Name of the table to model.
    * @param   string Name of the primary key field in the table.
    * @param   object JDatabase connector object.
These parameters are different from the 1.5 version of the JTable constructor, which for some reason is in the 1.7 example. This difference can cause the problem. You will most likely find some error codes in the PHP error log, if you have configured the errors to be logged.

_________________
toivo
my first programs were assembled and run in 16KB :)
http://archive.computerhistory.org/resources/text/GE/GE.GE-115SystemSoftware.1967.102646096.pdf#zoom=100


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 



Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group