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

  • Home
  • SEARCH
  • 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 7412327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:31:24+00:00 2026-05-29T06:31:24+00:00

I want to embed an HTML input form (search bar) in /View/Layouts/default.ctp (which is

  • 0

I want to embed an HTML input form (search bar) in /View/Layouts/default.ctp (which is Homepage presentation layout of the site). I’ve created /View/Elements/lookup.ctp with the following code (I wrote Element because I wanted to include that search bar on every page of the site):

<?php
echo $this->Form->create('Search', array('action' => 'lookup', 'accept-charset' => 'utf-8'));
echo $this->Form->input(array('type' => 'search', 'name' => 'search', 'placeholder' => 'enter search term'));
echo $this->Form->button('Search', array('type' => 'button', 'value' => 'submit')); 
echo $this->Form->end();
?>

The search bar itself should look like this:

___________________________     ______________
| enter search term       |    |  Search      | <--- button
|_________________________|    |______________|
    ↑
 search bar

The generated code in /View/Layouts/default.ctp must be like this:

<form id="searchForm" method="post" action="/searches/lookup" accept-charset="utf-8">
    <input type="search" name="search" placeholder="enter search term" />
    <button type="button" name="submit" value="submit">Search</button>
</form>

I included line:

<?php echo $this->element('lookup'); ?>

in /View/Layouts/default.ctp (which embeds the Element), but when I go to Homepage, it won’t render this element and the error appears:

( @Wylie: Yes, you’re right. It wasn’t the whole error. Here’s the complete error )

#0 C:\wamp\www\lib\Cake\Model\Datasource\DboSource.php(436): PDOStatement->execute(Array)
#1 C:\wamp\www\lib\Cake\Model\Datasource\Database\Mysql.php(307): DboSource->_execute('SHOW FULL COLUM...')
#2 C:\wamp\www\lib\Cake\Model\Model.php(1226): Mysql->describe(Object(Search))
#3 C:\wamp\www\lib\Cake\View\Helper\FormHelper.php(197): Model->schema()
#4 C:\wamp\www\lib\Cake\View\Helper\FormHelper.php(450): FormHelper->_introspectModel('Search', 'fields')
#5 C:\wamp\www\azil\View\Elements\lookup.ctp(2): FormHelper->create('Search', Array)
#6 C:\wamp\www\lib\Cake\View\View.php(595): include('C:\wamp\www\azi...')
#7 C:\wamp\www\lib\Cake\View\View.php(317): View->_render('C:\wamp\www\azi...', Array)
#8 C:\wamp\www\azil\View\Layouts\default.ctp(91): View->element('lookup')
#9 C:\wamp\www\lib\Cake\View\View.php(595): include('C:\wamp\www\azi...')
#10 C:\wamp\www\lib\Cake\View\View.php(411): View->_render('C:\wamp\www\azi...')
#11 C:\wamp\www\lib\Cake\View\View.php(373): View->renderLayout('<h2>Database ta...', 'default')
#12 C:\wamp\www\lib\Cake\Controller\Controller.php(900): View->render('error500', NULL)
#13 C:\wamp\www\lib\Cake\Error\ExceptionRenderer.php(282): Controller->render('error500')
#14 C:\wamp\www\lib\Cake\Error\ExceptionRenderer.php(191): ExceptionRenderer->_outputMessageSafe('error500')
#15 [internal function]: ExceptionRenderer->_cakeError(Object(MissingTableException))
#16 C:\wamp\www\lib\Cake\Error\ExceptionRenderer.php(165): call_user_func_array(Array, Array)
#17 C:\wamp\www\lib\Cake\Error\ErrorHandler.php(127): ExceptionRenderer->render()
#18 [internal function]: ErrorHandler::handleException(Object(MissingTableException))
#19 {main} [<b>CORE\Cake\Error\ErrorHandler.php

Missing table?! What missing table, it just need to add a couple of HTML lines inside a /View/Layouts/default.ctp. I don’t understand what’s going on. Please help. Thank you.

  • 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-29T06:31:25+00:00Added an answer on May 29, 2026 at 6:31 am

    Cake expects a Model to have a corresponding database table. Based on the incomplete error output Cake looks for a searches table in the database, but can’t find it. Because you include an element which contains a form belonging to the Search Model Cake queries the database for a description of the columns to correctly display the form.

    Are you certain you want to have a separate Controller and Model for searching? search could also be an action of the relevant Controller (the PostsController, for example).

    Of course, if you need a global Search model which can query several models (Posts, Pages, Users, for example) modelising might make sense. You can tell Cake that a Model doesn’t have a database table:

    public $useTable = false;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to embed an .asp page on an html page. I cannot use
I want to allow users to paste <embed> and <object> HTML fragments (video players)
I want to embed the native camera application into custom form. The RECT r
I want to embed a custom c# windows form (or WPF) user control into
I am using ASP.NET MVC 2 & C#. I want to include/embed an html
I want to embed some video into my HTML page. As background I want
<hr>I want to remove this text.<embed src=stuffinhere.html/> I tried using regex but nothing works.
I want to embed a partial view in an ASP.NET MVC page by returning
Which is the right/best tag to use in my HTML file when I want
I want to embed a wave file (or mp3) in html. There is no

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.