I need to override CIBlockPropertyDate
method for one component. I mean, I need to get what I want in one form, but leave the default behavior in other situations.
Is there a way to do that?
I need to override CIBlockPropertyDate
method for one component. I mean, I need to get what I want in one form, but leave the default behavior in other situations.
Is there a way to do that?
You can use Composer to autoload your classes.
In Bitrix you can place it in /local/
folder, for example under /local/lib/
folder.
Your /local/composer.json
file should look like this:
{
"autoload": {
"psr-4": {
"YourNamespace\\": "lib/YourNamespace"
}
}
}
Your custom classes should be placed under YourNamespace namespace in /local/lib/YourNamespace/
folder.
Your autoload file should be included in init.php
:
<?php
// file /local/php_interface/init.php
include_once $_SERVER['DOCUMENT_ROOT'].'/local/vendor/autoload.php';
And don't forget to run composer install
from /local/
folder to generate classmaps