hi,
have you found a solution for this problem, i try to do too but not working.
Laurent
-
☆ A M B ☆
- 24,524 Posts
Keep in mind that your paths will be relative to the index.php file; every snippet should be treated as a function being called from index.php (or manager/index.php if you’re writing a module).
ok thanks for your help Susan,
i want write in a xml files with a module (OnDocFormSave)
my file is in /assets/fichierXMLMP3/nomfichier.xml;
in module :
$fichierXMLMP3=$base_path.’/assets/fichierXMLMP3/nomfichier.xml’;
my file is not a resource modx.
-
☆ A M B ☆
- 24,524 Posts
As long as the $base_path variable is set correctly it should work. Have you tried to just echo the full path that it’s generating to make sure it’s correct? Sometimes these things will have an extra / or a missing / which will of course invalidate the path.
Try ’MODX_BASE_PATH’ .’assets.......................’ or ’$modx->config[’base_path’] .’assets.........’
Use MODx, or the cat gets it!
$fichierXMLMP3=$modx->getOption(’base_path’).’assets/fichierXMLMP3/nouvelle_vague.xml’;
work fine
thanks for your help
Laurent
Quote from: lolotlm at Oct 12, 2010, 02:06 AM
in module :
$fichierXMLMP3=$base_path.’/assets/fichierXMLMP3/nomfichier.xml’;
That should be:
$fichierXMLMP3=$base_path . 'assets/fichierXMLMP3/nomfichier.xml';
The MODx paths always include a trailing slash.