System Overview
The Dreams EMR Yii 3 template requires a modern web server environment with Yii 3 (yiisoft) framework support, PHP 8.2 - 8.5 compatibility, essential extensions, and development tools for optimal performance and development experience.
Core Technologies
Backend Framework
Yii 3 (yiisoft)
Frontend Framework
Bootstrap 5.3.8
Programming Language
PHP 8.4
System Requirements
Composer
For PHP package dependency management
PHP Extensions
intl, pdo, xml, ctype, iconv, json, mbstring, openssl, session, tokenizer, fileinfo
Node.js
For Vite build process & SCSS compilation
Text Editor
VS Code, Sublime Text, or any code editor
Development Tools
Local Server
XAMPP/WAMP/MAMP
Version Control
Git
Web Browser
Any modern browser
Important Note
Ensure all PHP extensions are enabled in your server configuration. For production deployment, consider using a managed hosting service that supports Yii 3 (yiisoft) and PHP 8.2 - 8.5.
Dreams EMR offers powerful admin template and modern interface.
Built-in Applications
- Calendar
- Chat
- To Do
- Notes
- File Manager
- Social Feed
- Kanban
- Call
Layout Features
- Creative Design
- Fully Responsive
- Color & Fonts is easily changed
- W3C Validated Code
- Build with Bootstrap v5.x used
- Compatible Browsers: IE8+, Firefox, Safari, Opera, Chrome
- Dark, Light with RTL Supported
- Various Sidebar Colours
- Multiple Layouts
Project Overview
The Yii project follows the Yii 3 (yiisoft) directory structure with the application located in dreams-emr/yii/. All template pages are in src/Web/Pages/: one action, the page list, two layouts, the partials and one template per page. The template assets are in public/assets/.
dreams-emr/ |_ yii/ | |_ config/ | | |_ common/ | | | |_ params.php | | | |_ routes.php (one route per page) | | | |_ di/ | | |_ console/ | | |_ environments/ | | |_ web/ | | | |_ di/application.php (middleware, incl. StripBasePathMiddleware) | |_ src/ | | |_ Web/ | | | |_ BasePath/ | | | | |_ StripBasePathMiddleware.php | | | |_ NotFound/ | | | |_ Pages/ | | | | |_ Action.php (the only page action) | | | | |_ pages.php (page slugs + auth layout pages) | | | | |_ layouts/ | | | | | |_ main.php (pages with topbar + sidebar) | | | | | |_ auth.php (login, sign-up, error, coming-soon ... pages) | | | | |_ partials/ | | | | | |_ title-meta.php | | | | | |_ head-css.php | | | | | |_ topbar.php | | | | | |_ sidebar.php | | | | | |_ footer.php | | | | | |_ modal-popup.php | | | | | |_ vendor-scripts.php | | | | |_ templates/ | | | | | |_ index.php | | | | | |_ patients.php | | | | | |_ ... (one file per page) | |_ public/ | | |_ assets/ | | | |_ css/ img/ js/ plugins/ scss/ | | |_ index.php | |_ runtime/ | |_ tests/ | |_ composer.json | |_ yii | |_ yii.bat
src/Web/Pages/layouts/main.php: Main Layout
The layout for every page with the topbar and sidebar. It renders the partials with $this->render() and prints the page with <?= $content ?>. The <html> and <body> tags of the layout demo pages (dark, RTL, mini ...) are chosen directly in the layout (shortened below). layouts/auth.php is the same without topbar, sidebar and modals.
<?php
declare(strict_types=1);
/**
* @var string $content
* @var string $page
* @var \Yiisoft\View\WebView $this
*/
?>
<!DOCTYPE html>
<?php if ($page === 'layout-dark') { ?>
<html lang="en" data-bs-theme="dark">
<?php } elseif ($page === 'layout-rtl') { ?>
<html lang="en" dir="rtl">
<?php } else { ?>
<html lang="en">
<?php }?>
<head>
<?= $this->render('../partials/title-meta') ?>
<?= $this->render('../partials/head-css') ?>
</head>
<?php if ($page === 'layout-mini') { ?>
<body class="mini-sidebar">
<?php } else { ?>
<body>
<?php }?>
<!-- Begin Wrapper -->
<div class="main-wrapper">
<?= $this->render('../partials/topbar') ?>
<?= $this->render('../partials/sidebar') ?>
<?= $content ?>
</div>
<!-- End Wrapper -->
<?= $this->render('../partials/modal-popup') ?>
<?= $this->render('../partials/vendor-scripts') ?>
</body>
</html>
src/Web/Pages/Action.php: Single Page Action
Every page is served by one action. The route slug selects the template, pages.php decides between the main and the auth layout, and the slug is passed to all views as $page - there is no per-page controller and no JSON data.
final readonly class Action
{
public function __construct(
private WebViewRenderer $viewRenderer,
private NotFoundHandler $notFoundHandler,
) {
$pages = require __DIR__ . '/pages.php';
$this->slugs = $pages['slugs'];
$this->auth = $pages['auth'];
}
public function __invoke(CurrentRoute $currentRoute, ServerRequestInterface $request): ResponseInterface
{
$slug = $currentRoute->getArgument('slug') ?? 'index';
if (!in_array($slug, $this->slugs, true)) {
return $this->notFoundHandler->handle($request);
}
$layout = in_array($slug, $this->auth, true) ? 'layouts/auth' : 'layouts/main';
return $this->viewRenderer
->withLayout('@src/Web/Pages/' . $layout . '.php')
// $page is shared with the template, the layout and every partial
->withAddedInjections(new class ($slug) implements CommonParametersInjectionInterface {
public function __construct(private string $page) {}
public function getCommonParameters(): array
{
return ['page' => $this->page];
}
})
->render(__DIR__ . '/templates/' . $slug);
}
}
src/Web/Pages/templates/patients.php: Page Template
Each template sets its title with $this->setTitle() and contains the page HTML. Pages with a footer render ../partials/footer.
<?php
declare(strict_types=1);
/**
* @var string $page
* @var \Yiisoft\View\WebView $this
*/
$this->setTitle('Patients');
?>
<div class="page-wrapper">
<div class="content">
<!-- Your page content goes here -->
</div>
<?= $this->render('../partials/footer') ?>
</div>
Routes and pages.php
// config/common/routes.php
Route::get('/')
->action(Web\Pages\Action::class)
->name('home')
->defaults(['slug' => 'index']),
Route::get('/patients')
->action(Web\Pages\Action::class)
->name('patients')
->defaults(['slug' => 'patients']),
// ... one route per page
// src/Web/Pages/pages.php
return [
'slugs' => ['add-doctors', 'index', 'patients', /* ... */],
'auth' => ['change-password', 'coming-soon', 'error-404', 'error-500', 'forgot-password',
'lock-screen', 'login', 'sign-up', 'under-maintenance'],
];
$page: Page-Specific Content
The partials use $page for the per-page checks (active menu item, page-specific CSS / JS, modals). Links and asset paths are relative (patients, assets/...), so they work at the domain root and in a sub folder such as http://localhost/yii/public/, where StripBasePathMiddleware removes the prefix.
<!-- partials/sidebar.php -->
<a href="patients" class="<?= ($page === 'patients') ? 'active' : '' ?>">Patients</a>
<!-- partials/vendor-scripts.php -->
<?php if ($page === 'form-fileupload') { ?>
<!-- Dropzone File Js -->
<script src="assets/plugins/dropzone/dropzone-min.js"></script>
<?php }?>
Adding a Page
- Create
src/Web/Pages/templates/my-page.php - Add
'my-page'toslugsinpages.php(and toauthfor a page without topbar and sidebar) - Add a
Route::get('/my-page')entry with->defaults(['slug' => 'my-page'])toconfig/common/routes.php - Link to it as
my-page, e.g. inpartials/sidebar.php
Yii 3 Framework Setup
Open terminal/command prompt in the project root directory and run:
Prerequisites
Installation Steps
Project Setup
Extract the Dreams EMR Yii project to your web server directory:
Install PHP Dependencies
Open terminal/command prompt in the Yii project directory and run:
composer install
Access Application
Start your web server and access the Yii application:
php yii serve
http://127.0.0.1:8080
yourdomain.com/yii/public/
The default font is Inter. To change the font:
Update the @import URL and the
--font-family-primary variable in style.css:
// Font
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
body {
font-family: "Inter", sans-serif;
}
The design token variables are defined in the @theme block of
your CSS file. Here are the primary color tokens:
Background Color Change
You can change the header background color in style.css as per your wish
.header {
background: #fff;
left: 0;
position: fixed;
right: 0;
top: 0;
height: 60px;
}
How it Works
Dark mode is Bootstrap 5's color mode: the data-bs-theme attribute on the <html> element. The light/dark button in the topbar switches it (assets/js/theme-script.js), and the layout-dark page starts in dark mode.
<html lang="en" data-bs-theme="dark">
Dark mode styles are defined in the [data-bs-theme=dark] blocks in style.css (source: assets/scss):
[data-bs-theme=dark] {
--menu-bg: #0B0D0E;
--menu-title-color: #E2E8F0;
--menu-item-color: #EEF2F7;
--menu-item-active-color: var(--primary);
/* ... */
}
The RTL demo page layout-rtl sets dir="rtl" on the <html> tag in layouts/main.php and loads the RTL build of Bootstrap in partials/head-css.php:
<?php if ($page !== 'layout-rtl') { ?>
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<?php }?>
<?php if ($page === 'layout-rtl') { ?>
<link rel="stylesheet" href="assets/css/bootstrap.rtl.min.css">
<?php }?>
Use RTL for Every Page
Add dir="rtl" to the default <html> tag in layouts/main.php and layouts/auth.php, and load bootstrap.rtl.min.css instead of bootstrap.min.css.
Use Tabler Icons with specific class
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Tabler Icon CSS -->
<link rel="stylesheet" href="assets/plugins/tabler-icons/tabler-icons.min.css">
</head>
</html>
<i class="ti ti-dashboard"></i>
<i class="ti ti-stethoscope"></i>
<i class="ti ti-chart-pie-3"></i>
The default layout features a full vertical sidebar on the left, a horizontal topbar at the top, and the main content area. This is the standard layout used across all dashboard pages.
- Full-width sidebar with navigation menu, logo, and user profile
- Top header with search, notifications, and user actions
- Responsive - sidebar collapses to overlay on mobile devices
The mini sidebar layout collapses the sidebar to show only icons, providing more space for the main content area. Users can toggle between expanded and collapsed states using the sidebar toggle button.
- Collapsed sidebar showing only menu icons
- Hover to expand and reveal full menu text
- Toggle via the sidebar button; see
layout-minifor a working demo
Besides the default and mini sidebar layouts, the template includes these layout demo pages. Each one is a normal page whose <html> / <body> tag is set in layouts/main.php:
layout-mini-data-layout="mini",<body class="mini-sidebar">layout-hoverview-data-layout="hoverview"layout-hidden-data-layout="hidden"layout-fullwidth-data-layout="full-width"layout-rtl-dir="rtl"layout-dark-data-bs-theme="dark"
Dreams EMR is developed by Dreams Technologies and is available under both Envato Extended & Regular License options.
Regular License
Usage by either yourself or a single client is permitted for a single end product, provided that end users are not subject to any charges.
Extended License
For use by you or one client in a single end product for which end users may be charged.
What are the main differences between the Regular License and the Extended License?
If you operate as a freelancer or agency, you have the option to acquire the Extended License, which permits you to utilize the item across multiple projects on behalf of your clients.
Need Support?
If this documentation does not address your questions, please feel free to contact us via email at support@dreamstechnologies.com
Reach the team at GMT+5:30. Typical reply within 12–24 hours on weekdays — rarely up to 48 hrs during holidays. Support is available to verified buyers for template-related issues.
Contact SupportImportant Note : We strive to offer top-notch support, but it's only available to verified buyers and for template-related issues such as bugs and errors. Custom changes and third-party module setups are not covered.
Do you need a customized application for your business?
If you need a customized application for your business depends on your specific requirements and goals, Please contact us. Customization can be the key to success, ensuring your project perfectly aligns with your unique goals and requirements.
Don't Miss Out on the Benefits of Customization!
Unlock the potential of your project. It's time to ensure your project isn't another cookie-cutter solution but truly unique and effective one.
Discover how customization can make a difference in your project's success. Let's create a solution that's as unique as your vision!
We'll tailor the application to meet your specific needs and preferences.
We will upload your website to the server and ensure it is live.
Thank You
Thank you once again for downloading Dreams EMR.
We hope you're enjoying your experience, and we kindly request that you take a
moment to share your valuable review and rating with us.