references:joomla.framework:application:jmodel-gettablegetTable
Creates an instance of the specified table class and returns a reference to it. If no name or prefix is specified, the class name will be created by appending the model name to ‘Table’. The name and prefix can only contain letters, numbers and the ‘_’ character. If the class does not exist, it will be looked for in the include paths that have been specified in the JTable class in a file with the same name as the table (thus a table class called TableExample1 should be placed in a file called example1.php). All file names should be lowercase. This method returns a reference to a JTable object if successful, null otherwise. Method to get a table object, load it if necessary. SyntaxJTable &getTable ( $name, $prefix )
ExamplesExample jimport( 'joomla.application.component.model' ); class PollModelPoll extends JModel { function __construct() { $config = array( 'table_path' => JPATH_COMPONENT.DS.'tables' ); parent::__construct( $config ); } } $model =& JModel::getInstance( 'poll', 'PollModel' ); $table =& $model->getTable(); $table->load( 14 ); echo $table->title; might produce Result Joomla! is used for?
|


