7

I know how to create a subfolder inside the media folder by using <media folder="media" destination="com_mycom"> in the manifest file. But how to create subfolder inside of the images folder during the installation of my custom component for example by using install script? What code do I need to add in the file or inside of public function install($parent) ?

1 Answer 1

5

Put in the header of install script:

jimport('joomla.filesystem.folder');

and inside of function install($parent) put the code:

$path = JPATH_SITE . DIRECTORY_SEPARATOR . "images" . DIRECTORY_SEPARATOR . "mycom";
$mode = 0755;
JFolder::create($path, $mode);

DIRECTORY_SEPARATOR for Joomla 3.x

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.