David
David

Reputation: 1144

Class not found when creating model

Hey guys I'm new in Zend Framework. I'm trying to create a connection and get the rows of a table, I make this in bootstrap.php

$this->bootstrap('db');
$m_routes = new Apartat() ;

It returns me this error: Fatal error: Class 'Apartat' not found in I'm trying to follow ZF quickstart but I'm lost

  1. I make models/Apartat.php

    <?php
    
    class Application_Model_Apartat
    {
    protected $_comment;
    protected $_created;
    protected $_email;
    protected $_id;
    
    }
    
  2. I make models/ApartatMapper.php

    <?php
    
    class Application_Model_ApartatMapper
    {
    }
    
  3. I make models/DbTabe/Apartat.php

    <?php
    
    class Application_Model_DbTable_Guestbook extends Zend_Db_Table_Abstract
    {
        protected $_name = 'guestbook';
    }
    

Previously I defined the connection parameters in application.ini

What else do I need? or what do I do wrong?

Upvotes: 0

Views: 90

Answers (1)

Alex
Alex

Reputation: 34978

Your class name is Application_Model_Apartat so you have to write

$m_routes = new Application_Model_Apartat() ;

Upvotes: 1

Related Questions