Welcome Guest, Not a member yet? Register   Sign In
Question about Matchbox / HMVC
#1

[eluser]HaRbY.me[/eluser]
Hi, i have a question about Matchbox / HMVC. I am trying to make the modules like this:

modules/
pages/
controllers
models
views
assets
language
admin/
controllers
models
views
assets
language
blog/
categories/
controllers
models
views
assets
language
admin/
controllers
models
views
assets
language
posts/
controllers
models
views
assets
language
admin/
controllers
models
views
assets
language

Is that possible? If you have any better ideas, tell me :-)
#2

[eluser]Phil Sturgeon[/eluser]
Yup, use Matchbox and my Asset library to get the modular assets working nicely.
#3

[eluser]HaRbY.me[/eluser]
But my modules are nested, isnt it a problem?
#4

[eluser]Phil Sturgeon[/eluser]
Good point, nested will be. I thought you were going for sub-directories.

Sub-dirs might be the way to go on this one dude.
#5

[eluser]HaRbY.me[/eluser]
Thank you dude, oh, and congrats for your CMS (Pyro) Smile I will give a try later, cause now i have to study for my University exams... :-(
#6

[eluser]dag[/eluser]
hi Phil,

thanks for the Assets Library. I am using HMVC and was wondering how i could use the Assets Library to load the Assets from Modules

I have the following structure

/
application
..modules
....testmodul
......controllers
......assets
.........js
..controllers
..libraries
...
system
assets
..css
..js
..img
index.php


at the moment the asset library is configured like that

$config['asset_dir'] = '';
$config['asset_url'] = config_item('base_url');
$config['asset_img_dir'] = 'img';
$config['asset_js_dir'] = 'js';
$config['asset_css_dir'] = 'css';

so it is working for the green assets dir but not for the red one

any help appreciated

thanks, dag
#7

[eluser]Phil Sturgeon[/eluser]
My library assumes assets and modules are both within the application folder. You'll have to modify the library. Let me know if you spot a good way to make that more dynamic. Perhaps add asset_module_dir to point to the modules location?
#8

[eluser]dag[/eluser]
well, it isn't even working they way i wrote above.. leaving the asset_dir config blank wasn't a good idea at all. guess i have to think about that whole thing again.

thanks for the advice!

dag
#9

[eluser]Phil Sturgeon[/eluser]
You need to be more specific than "not working". What exactly is happening? I assume its just building an incorrect path? Paste some debug in here or I have no way to help you.
#10

[eluser]dag[/eluser]
well right it wasn't building a correcht path when i left the assets_dir blank. guess this meant the assets were looked for relative to the current page. howeever that was my own stupidity :-)
changed that to:

Code:
$config['asset_dir'] = parse_url(config_item('base_url'), PHP_URL_PATH);

which is working well as my assets dir is within the web-root.

to get the library working with the modules resting inside the application dir, i followed your suggestion using a new config var

Code:
$config['asset_module_dir'] = parse_url(config_item('base_url'), PHP_URL_PATH) . 'application/modules/';

had to change the appropiate parts within the Assets.php library

Line 262:
Code:
$asset_location = $this->CI->config->item('asset_module_dir') . $module_name . '/assets/';

that fits my needs for now. whereby im not sure what about the url output, guess thats not working that way.

and one might change that theming thing which is right now just working for non-module assets

thanks for helping and for providing all that useful stuff for ci (like your rest-approach :-))

dag




Theme © iAndrew 2016 - Forum software by © MyBB