Issue with Tool inside of Package

Permalink
I am attempting to make a package that will contain a tool that will be called on attribute update.

My folder structure is as follows:
packages
--mycustomattribute
  --attributes
    --mycustomattribute
  --tools
    --mytool.php


I am using getToolsURL() to get the URL of my tool.
$url = Loader::helper('concrete/urls');
$tools_url = $url->getToolsURL('mytool','my_custom_attribute');


The value of $tools_url is:
http://localhost/index.php/tools/packages/my_custom_attribute/mytool


When I go to that URL there is no output. Despite /packages/mycustomattribute/tools/mytool.php containing nothing more than "HELLO?". Why does the tool inside my package not work?

 
WillemAnchor replied on at Permalink Reply
WillemAnchor
Make sure you have the file and mapnames right.
I see underscore _ differences in your folder structure and the output of $tools_url.

Why not go with namespacing

I have a 'tool' in:
/package/mypkg/src/tool.php
namespace Concrete\Package\Mypkg\Src;
class Tool extends \Database {
   public static function sayHello() {
      return 'hello';
   }
}

I include it in my controllers with:
use Concrete\Package\Mypkg\Src\Tool as Tool;

then I can do:
echo Tool::sayHello();