danelowe / glia Goto Github PK
View Code? Open in Web Editor NEWGlia - Join Cells in a Layout Layer
License: MIT License
Glia - Join Cells in a Layout Layer
License: MIT License
Allow a fully qualified class or class name to be passed to the class:
parameter in the cell
method
At the moment, cells are instantiated lazily, i.e. only when needed to render. This suits most simple cases, when we might want to construct the cell with specific parameters at the time of rendering.
However, in more complex cases, if the constructor of one cell needed to adjust cells elsewhere in the layout, e.g. add Javascript to the head, or adjust the breadcrumbs/navigation, it makes sense to have all of the cells instantiated as soon as the layout is loaded, and adjust each before rendering using methods rather than constructor arguments.
E.g. when the product details cell is instantiated, it adds the zoom javascript to the head cell, and adds a path to the breadcrumbs cell. This happens when the layout is loaded, so that by the time the head cell is rendered, it has all of the details it need.s
If a reference refers to a cell that does not exist in the merged layout, it most likely will cause an error. We should simply ignore the reference, perhaps with a warning.
If you app code is organised into modules, you may wish to keep a layout file in each module.
This way the layout files can each place cells related to their own modules on any page of the app.
Just wrap the DSL with Glia.area(:area_name) do .. end
,
then make sure the layout files are required as part of your app's bootstrap process.
Glia.area(:frontend) do
handle :pavlova_view do
reference name: :specifications do
remove name: :cake_specs
end
reference name: :cake_ingredients, template_name: 'cake/pavlova_ingredients' do
action name: :add_ingredient, args: ['Eggs', '6 Large']
end
end
end
layout = Glia.area(:frontend, [:default, :cake_view, :pavlova_view])
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.