Closed Shofiul-Alam closed 4 months ago
Thank you.
REST Api is planned and it will be added in a future release.
I changed ComponentBase to include View,Request and Session instances https://github.com/givanz/Vvveb/commit/d10f3bf87ef107bd50b7bfa8b00dbb1fe8fdc76d.
You can use $this->view
inside component methods without having to use $view = View::getInstance();
$this->options
can be used in any method like results or request to access component options set in the template
to access global options from ComponentBase like current site_id
you can use self::$global['site_id']
You can also return false in cacheKey
method to disable cache and have results called on each request where you can return data from view that was set from the controller.
class Post extends ComponentBase {
function cacheKey() {
//disable caching
return false;
}
//called on each request
function results() {
}
}
@givanz Thank you so much. This change will definitely help. I really appreciate your prompt action.
I reviewed your CMS system and I'm truly impressed by the innovative approach to caching and optimized performance. The adherence to MVC principles and separation of concerns is commendable. I particularly appreciate the simplicity of the CMS framework architecture and its minimal reliance on external libraries.
I am about to develop a new e-commerce solution for my company, and I am looking for a framework that integrates a page builder for our marketing team while also offering the flexibility to follow Domain-Driven Design patterns. Vvveb seems like the perfect framework for this purpose.
I have been studying the system code and core framework modules, and I am especially impressed by the powerful yet simple Vtpl template engine.
My project requires a significant amount of customization, including developing a 3D product configurator, enabling online quote requests, facilitating online booking for showroom visits, allowing customers to create mood boards, and most importantly, creating a REST API pipeline between our custom-developed ERP system and the new e-commerce solution.
During my research, I noticed that components such as
app/component/post.php
are bypassing any custom data passed from the action, relying solely on data retrieved from the database that was cached initially. This prevents me from passing any custom data outside the database model to the template when using placeholder attributes. Below is an example where I rewrote therequest()
method for the component:`//called on each request function request(&$results, $index = 0) { $request = Request::getInstance(); $created_at = $request->get['created_at'] ?? ''; //revision preview
This is also required for the results() method. I suggest improving it by providing View::instance() and component data through the BaseComponent class. Use properties and construction to make it available and include it in the result.