Views
Display a view
# Key not found for Example.View.display
Example of a View
The example docs have not been written yet
Make a view
Key not found for Usage.View.Packaged
Add a view by hand
This is the exact code used by Package
to add your views, found in your view
directory.
# Key not found for Usage.View.AddView
Add Callable
# Key not found for Usage.View.AddViewCallable
Replace an existing view
By default, when a view is added with the same as an existing name, an error will be
thrown. To change this, set the view conflict mode:
For your package
Pass 'views.conflict'=>'value'
to your package config where 'value'
is one of 'overwrite'
,
'ignore'
, or 'throw'
$site = new \Lia\Package($lia, __DIR__.'/code/', ['name'=>'MySite', 'views.conflict'=>'overwrite']);
//or
$site = new \Lia\Package($lia, __DIR__.'/code/');
$site->set('views.conflict', 'ignore');
//or
$site = new \Lia\Package($lia, __DIR__.'/code/');
$lia->set('package.MySite.views.conflict', 'throw');
You can also set views.conflict
in your config.json
file.
Directly
// 'throw' is the default. 'ignore' means the earlier view will be used
$lia->setViewConflictMode('overwrite');
$lia->addView('conflictingName', ....); // this will be the view used