CakePHP Folder Structure
- Admin
-
templates
-
element
- body.php / Body tag with attributes is stored in this common file.
- footer.php
- head-css.php / added common css files link in this file.
- horizontal.php / horizontal layout set in this file.
- main.php
- menu.php
- page-title.php / Set page-title in this file.
- right-sidebar.php / Contain the right sidebar theme customization HTML code.
- sidebar.php / Sidebar menu-related code is in this file.
- title-meta.php / Page title and meta tags are defined in this file.
- topbar.php / Topbar-related code is in this file.
- vendor-scripts.php / Common js files are linked in this file.
- pages
-
element
CakePHP file structure
We have used gulp to compile the html, scss and js files.
<?= $this->element("main") ?>
<head>
<?= $this->element('title-meta', array('title' => 'Dashboard')) ?>
<?= $this->element("head-css") ?>
</head>
<?= $this->element("body") ?>
<!-- Begin page -->
<div id="layout-wrapper">
<?= $this->element("menu") ?>
<!-- ============================================================== -->
<!-- Start right Content here -->
<!-- ============================================================== -->
<div class="main-content">
<div class="page-content">
<div class="container-fluid">
<?= $this->element('page-title', array('pagetitle' => 'Skote','title' => 'Dashboard')) ?>
</div>
<!-- container-fluid -->
</div>
<!-- End Page-content -->
<?= $this->element("footer") ?>
</div>
<!-- end main content-->
</div>
<!-- END layout-wrapper -->
<?= $this->element("right-sidebar") ?>
<?= $this->element("vendor-scripts") ?>
<!-- App js -->
<script src="/js/app.js">
</body>
</html>
Layout setup
You can set the default layout in the templates/element/main.php
file in the html tag.
<html data-topbar="light" data-layout-size="boxed">
data-sidebar-size="small" | To set small layout size. |
---|---|
data-layout-size="boxed" | To set boxed layout size. |
data-topbar="light" | To set the Light color of Topbar. |
data-topbar="dark" | To set the dark color of Topbar. |
data-topbar="colored" | To set the colored Topbar. |