Phase 14b-2: BasicTheme rewritten on iManager 2.0 stack#21
Merged
Conversation
The bundled basic theme now extends Frontend\Site and pulls every
service from the container — no remaining call into the legacy
imanager() function or editor/core/ classes survives the public
render path. Pagination, theme cache, template fragments, navigation,
archive, hero, contact and subscribe are all on 2.0 plumbing.
Key rewrites:
- BasicTheme (lib/Basic.php) extends Frontend\Site and overrides
init()+render(). Article list / archive use the typed
PageRepository methods (findInTimeRange, findByParent,
countByParent), pagination is built with iManager's Pagination
value object + PaginationRenderer. Single-article rendering
forces template `blog-post` via currentTemplate() instead of
mutating the Page DTO. Contact + subscribe + loadToken endpoints
preserved as a bridge with the new typed Request accessors and
JSON responses; CSRF placeholders are empty until 14c-1 wires
auth back.
- BasicRouter (lib/BasicRouter.php) collapsed to a 22-line wrapper
that dispatches actions and delegates routing to BasicTheme.
- _ext.php sets up BasicTheme + checks the FilesystemCache for a
SuperCache hit before invoking the router.
- lib/subscriber/MailChimp.php: typed properties, removed dead
Imanager\Util import, defensive defaults for missing config.
Frontend\Site additions for the theme surface:
- Properties: input (Imanager\Http\Request), templateParser
(TemplateRenderer), cache (FilesystemCache), msgs[]
- currentTemplate() override hook for blog-style routing
- getBasePath(), getPageUrl() (cycle-safe), addMsg()
- init() empty hook for theme subclasses
Frontend\PageRepository additions:
- findByParent(parent, orderBy, direction, activeOnly, offset, limit)
- findInTimeRange(start, end, parent, orderBy, direction)
- countByParent(parent, activeOnly)
- levels(rootParent, maxDepth, activeOnly, excludeIds) with
visited-set cycle detection (the migrated demo data has page id=8
pointing parent→8 to itself; would otherwise OOM the request)
- descendants(parent) with the same cycle guard
Theme files & data:
- resources/_tpls.php migrated from `[[VAR]]` to `{{var}}` so the
iManager TemplateRenderer (Phase 11) resolves them; pagination
fragments grouped under a `pagination` sub-array with the keys
PaginationRenderer expects (wrapper/link/current/prev/...).
- data/settings/basic-theme-config.php: dropped the static
Scriptor::getConfig() / BasicTheme::VERSION references that
don't autoload on the 2.0 stack — BasicTheme::init() merges the
live values from $site->config.
- template.php uses $site->currentTemplate() so the blog routing
can override without mutating the Page DTO.
- index.php delegates to the theme's _ext.php when present and
bails out cleanly when _ext.php returns early on a SuperCache hit.
Manual smoke (PHP built-in server):
GET / 200, 7.3 KB
GET /scriptors-demo-page 200, 7.5 KB (home alt)
GET /articles/ 200, 7.1 KB (article list)
GET /articles/page2/ 200, 5.8 KB (paginated)
GET /articles/get-started-with-scriptor 200, 7.7 KB (single article)
GET /contact 200, 7.1 KB (form)
GET /this-does-not-exist 404
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bundled basic theme now extends Frontend\Site and pulls every service from the container — no remaining call into the legacy imanager() function or editor/core/ classes survives the public render path. Pagination, theme cache, template fragments, navigation, archive, hero, contact and subscribe are all on 2.0 plumbing.
Key rewrites:
blog-postvia currentTemplate() instead of mutating the Page DTO. Contact + subscribe + loadToken endpoints preserved as a bridge with the new typed Request accessors and JSON responses; CSRF placeholders are empty until 14c-1 wires auth back.Frontend\Site additions for the theme surface:
Frontend\PageRepository additions:
Theme files & data:
[[VAR]]to{{var}}so the iManager TemplateRenderer (Phase 11) resolves them; pagination fragments grouped under apaginationsub-array with the keys PaginationRenderer expects (wrapper/link/current/prev/...).Manual smoke (PHP built-in server):
GET / 200, 7.3 KB
GET /scriptors-demo-page 200, 7.5 KB (home alt)
GET /articles/ 200, 7.1 KB (article list)
GET /articles/page2/ 200, 5.8 KB (paginated)
GET /articles/get-started-with-scriptor 200, 7.7 KB (single article)
GET /contact 200, 7.1 KB (form)
GET /this-does-not-exist 404