Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6009401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:57:54+00:00 2026-05-23T01:57:54+00:00

Controller: <?php class VideosController extends ForumAppController { /** * Controller Name * @access public

  • 0

Controller:

<?php
class VideosController extends ForumAppController {

    /**
     * Controller Name
     * @access public
     * @var string
     */
    public $name = 'Videos';


    public function index() {
        $videos = $this->Video->getVideos();
        $this->set('videos', $videos);
    }

    public function beforeFilter() {    
        parent::beforeFilter();

        $this->Auth->allow('*');

        if (isset($this->params['admin'])) {
            $this->Toolbar->verifyAdmin();
            $this->layout = 'admin';
        }       
        $this->Security->validatePost = false;
        $this->set('menuTab', 'videos');
    }

}

?>

Model:

<?php
class Video extends ForumAppModel {

    public $name = 'Video';

    function getVideos() {

        $vids = $this->find('all', array (
            'order'     =>  array('Video.id DESC')
        ));

      return $vids;
    }

}

?>

I get an error:

Notice (8): Undefined property: VideosController::$Video [CORE/plugins/forum/controllers/videos_controller.php, line 13]

If I do

$this->loadModel('video');

I get an error:

Warning (512): SQL Error: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'getVideos' at line 1 [CORE/cake/libs/model/datasources/dbo_source.php, line 549]
**Query: getVideos** 

Any ideas what might be causing this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T01:57:55+00:00Added an answer on May 23, 2026 at 1:57 am

    You code appears to be correct but it seems like CakePHP isn’t trying to load the model from the right place. You can specify the model to load using the $uses variable in your controller.

    Because you’re using a plugin, you need to add the name of the plugin in front of the model.

    $uses = array('Forum.Video');
    

    CakePHP should handle this on it’s own but some older version of CakePHP had a bug that prevented this from working properly. It appears to be fixed in 1.3.10.

    For more details about the $uses variable, see http://book.cakephp.org/view/961/components-helpers-and-uses.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<?php class Email extends Controller { function Email() { parent::Controller(); $this->load->library('email'); } function index()
This is my AdminBase.php <?php class AdminBase extends Controller{ public function __construct(){ parent::Controller(); $admin
<?php class PI_Controller_Plugin_AssetGrabber extends Zend_Controller_Plugin_Abstract { public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request) { /* The module
i have the codes below class ReservationController extends Zend_Controller_Action { public function init() {
I'm studying this code: http://www.w3style.co.uk/a-lightweight-and-flexible-front-controller-for-php-5 In it the author uses a static function to
I am developing with CakePHP and this is my Page Controller: <?php class PagesController
I have a a controller referral_medium_controller.php with the following content <?php class ReferralMediumsController extends
I use the following the jquery statements to call my php controller function, it
I have an htaccess file that uses mod_rewrite to redirect /controller to /index.php?controller=%controller% Like
In core.php I can define Configure::write('Routing.admin', 'admin'); and /admin/controller/index will work. but if I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.