When you use Theme, you can't use Asset like that, the Asset class is not theme aware, so it doesn't know where to find your assets. Instead, you need to use Theme's asset extension.
When Theme can't find a View file, it reverts back to looking for a standard view file. If that can't be found either, it fails. That is why you get the exception about APPPATH./views...
No, it only uses the Finder in case the requested View is not found in the configured theme folders. It's just a fallback, so you can also do a set_partial() using a standard view.
And no, it loads the views you specify from the root of the theme folder. Normally all you have in there are views, so having a 'views' folder is not really needed. But you can just name your views like that? So if you do set_partial('views/this/that'), it will load APPPATH///views/this/that.php.
...that would work, you can add multiple partials to a section.
Instead of creating a separate asset instance and use Asset::instance(), it's better to use Theme::instance()->asset, which is an automatically created asset instance that is aware of the theme paths.
Thanks for an advice
I have another question about Themes Config file. I tried to use YAML cfg instead of standard PHP. So my theme config looks like:
return array(
'active' => 'semantic_ui_theme',
'fallback' => 'default',
'paths' => array( // theme files are outside the DOCROOT here
APPPATH.'themes'.DS.'back-end'.DS,
),
'assets_folder' => 'themes', // so this implies /public/themes/...
'view_ext' => '.php',
'require_info_file' => false,
'info_file_name' => 'theme_info',
'info_file_type' => 'yaml',
'use_modules' => true,
);
but the theme initialization fails, unless i specify the file-type in 'info_file_name'
So this will work fine:
$theme->set_chrome('sidebar', 'chrome/rounded-corners', 'content');
$theme->set_partial('sidebar', \View::forge('test_1')->set('hello', 'world'));
$theme->set_partial('sidebar', \View::forge('test_1')->set('hello', '..not overwritten!'));
"info_file_type" is not used anywhere anymore, so that looks like a bug in the documentation.
...
Can you make an issue...
It looks like you're new here. If you want to get involved, click one of these buttons!