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 8363735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:15:28+00:00 2026-06-09T12:15:28+00:00

hi all in my view I’m getting this error when trying to print out

  • 0

hi all in my view I’m getting this error when trying to print out information in my array.

here is my function in the controller

public function view($name)
$fields = $this->Template->Field->find('list',array( 
          'fields'=> array('name'),
          'conditions' => array(
          'template_id'=> $name)));
$this->set('field', $fields);

here is the view

</br><h2>Here is your template fields</h2></br>

            <?php if(!empty($field))
                  {
                    foreach($field as $name)
                    {?>
                        <tr>
                        <td>
                        <?php echo $name['Field']['name']; ?>
                        </tr></br>
                        <?php
            }
            }
            else
            {?>
             <tr> <td>No Templates Found.</td></tr>
             <?php 
             }?>
  • 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-06-09T12:15:29+00:00Added an answer on June 9, 2026 at 12:15 pm

    As I already answer some of your questions. So what I understood about your project is “Template hasMany Fields” and you already defined an association-ship in the corresponding models.

    You should use the following code into your view:

    <?php if(!empty($field))
                  {
                    foreach($field as $name)
                    {?>
                        <tr>
                        <td>
                        <?php echo $name; ?>
                        </td>
                        </tr>
                        <?php
            }
            }
            else
            {?>
             <tr> <td>No Template Fields Found.</td></tr>
             <?php 
             }?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Pages table that stores all my view urls and this table
We had a View Model that looked like this: public class myViewModel { public
I have an iPhone Application with multiple view controllers , in all view controller's
So, I put all this logic in my view, thinking it would be helpful
I want all view controllers to support only portrait mode, except one view controller
How to view all the content in my IsolatedStorageFile by setting a new page
I know how to view all changes in a changeset.. But let's say you
Is there any way how to view all sent parameters if I do not
I would like to add a GestureDetector to all views (view groups) of an
I have a custom UIViewController subclass that handles all the view initialization by itself

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.