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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:33:17+00:00 2026-06-12T02:33:17+00:00

hi all I have a cakephp page, when you hover over a link it

  • 0

hi all I have a cakephp page, when you hover over a link it displays the correct link however when you click the link it takes you to a completely different/wrong page.

i assume its an error with my view, so I’ll include the relevant part of the site here, what is happening is the add link is taking users to fields/view NOT fields/add_new

        <tr>
                <td align='center'><?php echo $templates['Template']['name'] ;?></td>
            <td align='center'><?php echo $templates['Template']['description']; ?> </td>
                <td align='center'>
                    <?php echo $this->Form->Html->link('Add', array('controller' => 'Fields','action'=>'add_new',$templates['Template']['id'])); ;?> |
                    <?php echo $this->Form->Html->link('View', array('controller' => 'Fields','action'=>'view',$templates['Template']['id'])); ;?> |
                    <?php echo $this->Form->Html->link('Edit', array('controller' => 'Templates','action'=>'edit',$templates['Template']['id'])); ;?> |
                    <?php echo $this->Form->Html->link('Delete', array('controller' => 'Templates','action'=>'delete',$templates['Template']['id'])); ;?></td> 
         <tr>





function add_new($id=null){
        //allows users to add another field to an existing template
        $this->set('title_for_layout', 'Create Fields');
        $this->set('stylesheet_used', 'homestyle');
        $this->set('image_used', 'eBOXLogoHome.png');
        $this->layout='home_layout';


        if(($this->Field->save($this->request->data)))
        {

        $id = $this->data['Field']['template_id'];

        $this->set('id',$id);
        $this->redirect(array('controller'=>'Fields', 'action'=>'view',$id));

        }
            $this->set('id',$id);
        }
  • 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-12T02:33:19+00:00Added an answer on June 12, 2026 at 2:33 am
    function add_new($id=null){
            //allows users to add another field to an existing template
            $this->set('title_for_layout', 'Create Fields');
            $this->set('stylesheet_used', 'homestyle');
            $this->set('image_used', 'eBOXLogoHome.png');
            $this->layout='home_layout';
    
    
            //this sets the parameter as a variable 
            $this->set('id', $id);
            //if the data posts to the databse
            if($this->request->is('post'))
            {
                //creates an instance of field in the database
                $this->Field->create(); 
                //if the field saves to the database
                if ($this->Field->save($this->request->data))
                {   //if the user clicks this button
                    $id = $this->data['Field']['template_id'];
    
                    $this->set('id',$id);
                    $this->redirect(array('controller'=>'Fields', 'action'=>'view',$id));
    
    
                }
    
            }
    
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have my Authentication setup in CakePHP to redirect all users to a dashboard
I have 50 newsletters which all have different email accouts, hex colour codes and
i have hundreds of [mostly different] files in many different directories that all have
I have previously used CakePHP's routing functionality with the greedy star, allowing all the
I am coding on cakephp 1.3. I have a problem redirecting the page to
I want to have an application that displays all of my website's external links
I have about 8 entities that all have a one to one relationship with
I have a situation where all my selectors all have the same ancestor element
I have three classes that all have a static function called 'create'. I would
I have an NSMenu (belonging to an NSPopUpButton ) where the NSMenuItem all have

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.