# Facing some issues with structure

**URL:** <https://discourse.cakephp.org/t/facing-some-issues-with-structure/4468>\
**Category:** Need Help\
**Tags:** behavior\
**Created:** [June 25, 2018, 2:39pm UTC](https://discourse.cakephp.org/t/facing-some-issues-with-structure/4468 "2018-06-25T14:39:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maan](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/maan/32/628_2.png) [@Maan](https://discourse.cakephp.org/u/Maan)\
**Post date:** [June 25, 2018, 2:39pm UTC](https://discourse.cakephp.org/t/facing-some-issues-with-structure/4468/1 "2018-06-25T14:39:02Z")

</div>

here is the custom config file created by some developer(app/customconfig.php) and called in bootstrap.php

define(“SITE\_URL”, “[http://localhost:8765/](http://localhost:8765/)”);

> define(“APP\_NAME”, “MyWeb”);  
> define(“SITE\_LAYOUT”, “default”);  
> define(“ADMIN\_LAYOUT”, “admin”);  
> define(“ADMIN\_LOGIN\_LAYOUT”, “admin\_login”);  
> define(“VENDOR\_LOGIN\_LAYOUT”, “vendor\_login”);  
> define(“NOT\_AVAILABLE”, “Not Available”);  
> define(“USER\_ROLE\_BUSINESS\_OWNER”, 1);  
> define(“USER\_ROLE\_ADMIN”, 2);  
> define(“EMAILS\_ENABLED”, true);  
> define(“EMAIL\_FROM”, “[help@MyWeb.com](mailto:help@MyWeb.com)”);  
> define(“EMAIL\_FROM\_NAME”, “MyWeb”);  
> define(“SEND\_CLIENT\_REGISTRATION\_EMAIL”, true);  
> define(“SEND\_VENDOR\_REGISTRATION\_EMAIL”, true);  
> define(“DELETED”, true);  
> define(“NOT\_DELETED”, false);  
> define(“ADMIN\_DATE\_FORMAT”, “Y-m-d”);  
> define(“ADMIN\_DATE\_TIME\_FORMAT”, “Y-m-d h:i:s A”);  
> define(“ADMIN\_TIME\_FORMAT”, “h-i-s A”);  
> define(“APP\_USER\_ADMIN”, 1);  
> define(“APP\_USER\_VENDOR”, 2);

in view and controller functions this is called in this way

but when view renders it show error like this  
`Warning (2): Use of undefined constant SITE_URL - assumed 'SITE_URL' (this will throw an Error in a future version of PHP) in [C:\xampp\htdocs\pocketpagitclone\src\Template\Layout\default.ctp, line 25] Request URL: /appointments/save Referer URL: http://localhost:8765/appointments Trace: Cake\Error\BaseErrorHandler::handleError() - CORE\src\Error\BaseErrorHandler.php, line 153 include - APP/Template\Layout\default.ctp, line 25 Cake\View\View::_evaluate() - CORE\src\View\View.php, line 1025 Cake\View\View::_render() - CORE\src\View\View.php, line 986 Cake\View\View::renderLayout() - CORE\src\View\View.php, line 657 Cake\View\View::render() - CORE\src\View\View.php, line 615 Cake\Controller\Controller::render() - CORE\src\Controller\Controller.php, line 623 Cake\Http\ActionDispatcher::_invoke() - CORE\src\Http\ActionDispatcher.php, line 125 Cake\Http\ActionDispatcher::dispatch() - CORE\src\Http\ActionDispatcher.php, line 93 Cake\Http\BaseApplication::__invoke() - CORE\src\Http\BaseApplication.php, line 78 Cake\Http\Runner::__invoke() - CORE\src\Http\Runner.php, line 65 Cake\Routing\Middleware\RoutingMiddleware::__invoke() - CORE\src\Routing\Middleware\RoutingMiddleware.php, line 59 Cake\Http\Runner::__invoke() - CORE\src\Http\Runner.php, line 65 Cake\Routing\Middleware\AssetMiddleware::__invoke() - CORE\src\Routing\Middleware\AssetMiddleware.php, line 88 Cake\Http\Runner::__invoke() - CORE\src\Http\Runner.php, line 65 Cake\Error\Middleware\ErrorHandlerMiddleware::__invoke() - CORE\src\Error\Middleware\ErrorHandlerMiddleware.php, line 92 Cake\Http\Runner::__invoke() - CORE\src\Http\Runner.php, line 65 DebugKit\Middleware\DebugKitMiddleware::__invoke() - ROOT\vendor\cakephp\debug_kit\src\Middleware\DebugKitMiddleware.php, line 52 Cake\Http\Runner::__invoke() - CORE\src\Http\Runner.php, line 65 Cake\Http\Runner::run() - CORE\src\Http\Runner.php, line 51 Cake\Http\Server::run() - CORE\src\Http\Server.php, line 80 [main] - ROOT\webroot\index.php, line 3`

---

<div class="post-metadata">

**Author:** ![Marcel](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/marcel/32/329_2.png) [@Marcel](https://discourse.cakephp.org/u/Marcel)\
**Post date:** [June 27, 2018, 7:47am UTC](https://discourse.cakephp.org/t/facing-some-issues-with-structure/4468/2 "2018-06-27T07:47:52Z")

</div>

Why not to append these settings to cakes config array ? Storing user configuration in constants sounds like hard coding to me. I would store these settings in db table, and load them into session after successful authentication. But if from any reason you still want to stick to constants put them into bootstrap or regular config file.
