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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:36:45+00:00 2026-06-17T17:36:45+00:00

I use the CakePHP framework and I want to have multiple templates in my

  • 0

I use the CakePHP framework and I want to have multiple templates in my project.
Is there any way for implementation of multiple templates in CakePHP?

For example, an admin can choose first the or second template in the backend and users can use the same template. (Like in the Joomla backend). If there is any way, how can I implement 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-06-17T17:36:47+00:00Added an answer on June 17, 2026 at 5:36 pm

    Just giving you basic idea about how you can do that.

    In app_controller try below code.

    <?php
    class AppController extends Controller
    {
        var $components = array( 'Auth','Session', 'RequestHandler','Email','Gzip.Gzip','SwiftMailer');
    
        var $helpers = array( 'Javascript', 'Form', 'Html', 'Session','Time','Custom','Paginator','Text' );
    
        function beforeFilter()
        {
            if(isset($this->params['admin']) && $this->params['admin'] == 1)
            {
                $this->layout = "admin";
            }
            else
            {
                $this->layout = "default";
            }       
        }
    ?>

    And inside other controller file which extends app_controller add you must have code as below.

    <?php
    class OtherController extends Controller
    {
        var public $uses = array('ModelName');
    
        function beforeFilter()
        {
            parent::beforeFilter();
        }
    ?>

    You can also overwrite $this->layout to every controller action.

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

Sidebar

Related Questions

I use Notepad++ and Aptana for editing my CakePHP code? Is there any way
Is there any way to use both the jquery and scriptaculous js files together?
I use the cakePHP framework I have a question about how models handle MySQL
How do you use cakephp to count, for example the number of posts, made
I have used cakePHP 1.2 and know how to use behaviors in it. using
I am using Cakephp as my framework. I have a problem in uploading my
Is there any way to embed a wiki inside a PHP application? My specific
I'm deciding on a web framework for an upcoming project, and I'd appreciate any
I have build an e-commerce website with CakePHP Framework. Now, i need to implement
When I try to run my project (made with cakephp framework), I receive this

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.