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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:03:02+00:00 2026-06-09T15:03:02+00:00

I have a controller say class_controller.php . But I don’t want to create its

  • 0

I have a controller say class_controller.php. But I don’t want to create its view. So what should be written in the controller?

I like if you don’t want any model to be related we use var $uses = null; likewise what is the code for not relating to its view?

  • 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-09T15:03:03+00:00Added an answer on June 9, 2026 at 3:03 pm

    It is easy to disable both the layout and view in CakePHP by putting the following line in your controller action:

    $this->autoRender = false;

    If you want to disable just the layout, use the following line in your controller action:

    $this->layout = false;

    And if you only want to disable the view for this action, use the following line in your controller:

    $this->render(false);

    Note: This will be action specific and not controller as you have asked for.

    You can do the trick using beforeFilter() function which will call before every action in your controller & disable layout for you.

    public function beforeFilter() {
        parent::beforeFilter();
        $this->autoRender = false;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have a PHP Model-View-Controller framework that maps an address like http://example.com/admin/posts/edit/5
I have a simple controller like this (no, not really, but let's say I
Say I have the string s = Controller = require 'controller' class foo view:
Say I have a class ObjectA (a view controller for example), that does this
I have a method in a controller say like this. In fact, I'm in
I have a controller that should add a person to the db, but in
Let’s say I have a view controller, or a window controller, which is (as
Lets say I have a controller class like this. public class InStorePickupController : Controller
If I have: require_once(bla.php); class controller{.....} If I then create in a different file
lets say I have two methods in my controller to support both json and

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.