On Thu, Jan 20, 2011 at 3:49 PM, Adam Richardson wrote:
> On Thu, Jan 20, 2011 at 5:33 PM, Tommy Pham wrote:
>>
>> Hi folks,
>>
>> I thought I try implementing namesapce on one the ported apps I did a
>> while
>> back but ran into a problem. First the code:
>>
>> //namespace org\puremvc\php\interfaces;
>>
>> interface ICommand
>> {
>> function execute(INotification $notification);
>> }
>> interface INotifier
>> {
>> function sendNotification($notificationName, $body = null, $type =
>> null);
>> }
>>
>> //--------------------------------------------------------------------------
>> ---
>> //namespace org\puremvc\php\patterns\observer;
>> //use org\puremvc\php\interfaces\INotifier;
>>
>> class Notifier implements INotifier
>> {
>> public function __construct() { echo __METHOD__; }
>> public function sendNotification($notificationName, $body = null, $type
>> = null)
>> {
>> }
>> }
>>
>> //--------------------------------------------------------------------------
>> ---
>> //namespace org\puremvc\php\patterns\command;
>> //use org\puremvc\php\interfaces\ICommand;
>> //use org\puremvc\php\interfaces\INotifier;
>> //use org\puremvc\php\patterns\observer\Notifier;
>>
>> class SimpleCommand extends Notifier implements ICommand, INotifier
>> {
>> public function __construct() { parent::__construct(); echo ' -> ';
>> echo __METHOD__; }
>> function execute(INotification $notification) { }
>> }
>
> Where's the INotification namespace? If it's in org\puremvc\php\interfaces,
> you'll have to include it, too. I see you just included the whole set of
> interfaces in the top part of the example. Maybe you just omitted the code,
> but that could be the problem.
> Adam
>
> --
> Nephtali: A simple, flexible, fast, and security-focused PHP framework
> http://nephtaliproject.com
>
Hi Adam,
The error didn't complain about that even if I use without the
namespace... possible bug? :)) Anyway, I found the problem: \N in
use org\puremvc\php\patterns\observer\Notifier;
I think I should submit request for change from \ to / to prevent
escaping. and makes using of namespace more natural.
Thanks,
Tommy
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php