مستندات «کاراوب» — قالب minimal
این صفحه بهصورت داینامیک ساختار فایلهای پروژه را نمایش میدهد و توضیح میدهد چگونه قالب اختصاصی خود را بسازید و روی cPanel مستقر کنید.
مسیر
public_html
داکیومنتروت است؛ هسته در management-core
نگهداری میشود تا امنیت و نظم بهتری داشته باشد.معماری تممحور
- تم فعال از طریق
.env
(کلیدAPP_THEME
) یاconfig/app.php
تعیین میشود. - هر تم یک
theme.json
دارد که CSS/JS ورودی، گزینههای RTL و مسیر README را مشخص میکند. - ساختار تم:
layouts/
(پوسته اصلی)،partials/
(اجزای تکرارپذیر)،pages/
(نمای صفحهها).
راهنمای ساخت «قالب اختصاصی»
- در مسیر
management-core/themes
یک پوشه با اسلاگ دلخواه بسازید (مثلاًmytheme
). theme.json
را مشابه نمونهٔminimal
ایجاد کنید و فایلهای CSS/JS اختصاصی را معرفی نمایید.- سه پوشهٔ
layouts
،partials
،pages
را بسازید. فایلlayouts/main.php
باید متغیر$content
را رندر کند. - از
partials/head.php
برای متاتگها و لینک داراییها استفاده کنید؛ از کلاسCore\Theme
برای خواندنtheme.json
بهره ببرید. - فایلهای صفحه مثل
pages/home.php
را مطابق نامی که در کنترلر بازمیگردد ایجاد کنید. - برای فعالسازی تم، مقدار
APP_THEME=mytheme
را درmanagement-core/.env
تنظیم کنید.
ساختار فایلها
Document Root (public_html)
/public_html/assets
پوشه
/public_html/assets/common
پوشه
/public_html/assets/common/css
پوشه
/public_html/assets/common/js
پوشه
/public_html/assets/fonts
پوشه
/public_html/assets/fonts/IRANSans
پوشه
/public_html/assets/fonts/Vazirmatn
پوشه
/public_html/assets/fonts/Vazirmatn/static
پوشه
/public_html/assets/themes
پوشه
/public_html/assets/themes/minimal
پوشه
/public_html/assets/themes/minimal/css
پوشه
/public_html/assets/themes/minimal/images
پوشه
/public_html/assets/themes/minimal/js
پوشه
/public_html/assets/vendor
پوشه
/public_html/.htaccess
پیکربندی آپاچی برای ریدایرکتها، بازنویسیها، امنیت و کش داراییهای استاتیک.
/public_html/README.md
409 بایت
/public_html/assets/.gitkeep
0 بایت
/public_html/assets/common/css/base.css
0 بایت
/public_html/assets/common/js/app.min.js
9720 بایت
/public_html/assets/fonts/IRANSans/IRANSans.woff
34520 بایت
/public_html/assets/fonts/IRANSans/IRANSans.woff2
29256 بایت
/public_html/assets/fonts/Vazirmatn/static/Vazirmatn-Bold.woff2
51020 بایت
/public_html/assets/fonts/Vazirmatn/static/Vazirmatn-Regular.woff2
50684 بایت
/public_html/assets/fonts/Vazirmatn/static/Vazirmatn[wght].woff2
111152 بایت
/public_html/assets/fonts/fonts.css
1196 بایت
/public_html/assets/themes/minimal/css/fonts.css
2095 بایت
/public_html/assets/themes/minimal/css/style.css
5229 بایت
/public_html/assets/themes/minimal/images/caraweb-hero.jpg
95360 بایت
/public_html/assets/themes/minimal/images/en.svg
1484 بایت
/public_html/assets/themes/minimal/images/ir.svg
4983 بایت
/public_html/assets/themes/minimal/images/karaweb-logo-light.png
86258 بایت
/public_html/assets/themes/minimal/js/app.js
794 بایت
/public_html/error_log
6636 بایت
/public_html/index.php
نقطهٔ ورود وبسایت. بوتاسترپ هسته را از مسیر management-core بارگذاری و اجرای برنامه را آغاز میکند.
Core (management-core)
/management-core/app
پوشه
/management-core/app/Content
پوشه
/management-core/app/Content/Mapper
پوشه
/management-core/app/Content/Model
پوشه
/management-core/app/Controllers
پوشه
/management-core/app/Core
پوشه
/management-core/bootstrap
پوشه
/management-core/config
پوشه
/management-core/scripts
پوشه
/management-core/storage
پوشه
/management-core/storage/cache
پوشه
/management-core/storage/logs
پوشه
/management-core/storage/sessions
پوشه
/management-core/storage/tmp
پوشه
/management-core/themes
پوشه
/management-core/themes/minimal
پوشه
/management-core/themes/minimal/layouts
پوشه
/management-core/themes/minimal/pages
پوشه
/management-core/themes/minimal/partials
پوشه
/management-core/vendor
پوشه
/management-core/.env
تنظیمات حساس محیطی (URL، تم، حالت دیباگ). از .env.example کپی و سفارشی کنید.
/management-core/.env.example
911 بایت
/management-core/.gitignore
62 بایت
/management-core/app/Content/ContentProvider.php
1021 بایت
/management-core/app/Content/LocalContentProvider.php
3444 بایت
/management-core/app/Content/Mapper/LocalMapper.php
3177 بایت
/management-core/app/Content/Model/Media.php
952 بایت
/management-core/app/Content/Model/MenuItem.php
624 بایت
/management-core/app/Content/Model/Page.php
2050 بایت
/management-core/app/Content/Model/Post.php
1952 بایت
/management-core/app/Content/Model/SeoData.php
1820 بایت
/management-core/app/Content/ProviderFactory.php
684 بایت
/management-core/app/Controllers/DocsController.php
4882 بایت
/management-core/app/Controllers/ErrorController.php
1065 بایت
/management-core/app/Controllers/HomeController.php
4031 بایت
/management-core/app/Controllers/StaticPageController.php
1684 بایت
/management-core/app/Core/App.php
3037 بایت
/management-core/app/Core/Controller.php
568 بایت
/management-core/app/Core/Csrf.php
611 بایت
/management-core/app/Core/Env.php
1081 بایت
/management-core/app/Core/Helpers.php
7806 بایت
/management-core/app/Core/RateLimiter.php
1676 بایت
/management-core/app/Core/Request.php
879 بایت
/management-core/app/Core/Response.php
2100 بایت
/management-core/app/Core/Router.php
4046 بایت
/management-core/app/Core/Security.php
4592 بایت
/management-core/app/Core/Session.php
915 بایت
/management-core/app/Core/Theme.php
2372 بایت
/management-core/app/Core/Validator.php
3438 بایت
/management-core/app/Core/View.php
2199 بایت
/management-core/app/helpers.php
2300 بایت
/management-core/bootstrap/autoload.php
راهانداز ایمن هسته؛ تعریف کانستنتها، اتولود کامپوزر، و هندلینگ خطا/استثناء.
/management-core/bootstrap/errors.php
3945 بایت
/management-core/composer.json
619 بایت
/management-core/composer.lock
17246 بایت
/management-core/config/app.php
پیکربندی برنامه (نام، مود، timezone، URL، تم فعال).
/management-core/config/assets.php
396 بایت
/management-core/config/routes.addition.php
125 بایت
/management-core/config/routes.php
تعریف مسیرها (Routeها) و اتصال به کنترلرها.
/management-core/config/security.php
2862 بایت
/management-core/config/theme.php
49 بایت
/management-core/error_log
206 بایت
/management-core/scripts/build-static.php
7563 بایت
/management-core/scripts/dev-router.php
411 بایت
/management-core/storage/logs/.gitkeep
0 بایت
/management-core/storage/logs/app.log
22729 بایت
/management-core/storage/logs/contact.log
19782 بایت
/management-core/storage/logs/php-error.log
23812 بایت
/management-core/storage/sessions/.gitkeep
0 بایت
/management-core/storage/tmp/.gitkeep
0 بایت
/management-core/themes/minimal/README.fa.md
5268 بایت
/management-core/themes/minimal/_compat.php
819 بایت
/management-core/themes/minimal/layouts/main.php
1525 بایت
/management-core/themes/minimal/pages/404.php
139 بایت
/management-core/themes/minimal/pages/about.php
536 بایت
/management-core/themes/minimal/pages/contact.php
722 بایت
/management-core/themes/minimal/pages/docs.php
5463 بایت
/management-core/themes/minimal/pages/error.php
160 بایت
/management-core/themes/minimal/pages/home.php
5638 بایت
/management-core/themes/minimal/pages/service.php
920 بایت
/management-core/themes/minimal/pages/support.php
141 بایت
/management-core/themes/minimal/partials/footer.php
756 بایت
/management-core/themes/minimal/partials/head.php
3960 بایت
/management-core/themes/minimal/partials/header.php
4260 بایت
/management-core/themes/minimal/theme.json
مانیفست تم: لیست CSS/JS، تنظیمات RTL و مستندات مرتبط.
الگوی سریع برای theme.json
{
"name": "mytheme",
"slug": "mytheme",
"version": "1.0.0",
"parent": null,
"entry": {
"css": [
"\/assets\/vendor\/bootstrap\/css\/bootstrap.rtl.min.css",
"\/assets\/themes\/mytheme\/css\/style.css"
],
"js": [
"\/assets\/vendor\/bootstrap\/js\/bootstrap.bundle.min.js",
"\/assets\/themes\/mytheme\/js\/app.js"
]
},
"options": {
"rtl": true
},
"docs": {
"readme": "themes\/mytheme\/README.fa.md"
}
}
بهترینروشها
- داراییهای تم را در
/public_html/assets/themes/<slug>
قرار دهید تا کش و CDN ساده شود. - از کلاس
Core\Security
و هلسپرCore\e()
برای خروجی امن HTML استفاده کنید. - فرمها را با
Core\Csrf::field()
در برابر CSRF محافظت کنید. - مسیرها را در
config/routes.php
تعریف و به اکشنهای کنترلر متصل کنید.