I currently am developing a plugin to gather XML restful data. At one point in the file, I need to reference another PHP file, which will process various data.
As a test, the code in the included file should return output, as well (see code below).
I've tried to utilize the following code, but it doesn't work. There is no error message, but again there is no data output.
Craft::import('plugins.aifeed.resources.Date_Formatting');
I've been looking here, but it wasn't clear to me how or if the 'included' file could be utilized. Thanks for any leads.
Here is my code:
in Variables folder: AiFeedVariable.php
<?php
namespace Craft;
class AiFeedVariable
{
public function XmlVariable($optional = null)
{
....
$strSampleDate = '2015-12-23';
Craft::import('plugins.aifeed.resources.Date_Formatting');
}
}
in Resources folder: DateFormatting.php
<?php
namespace Craft;
class DateFormatting
{
$strDate_A=$strSampleDate;
echo '$strDate_A test...'.$strDate_A.'<br>';
}