+ Reply to Thread
Results 1 to 4 of 4

Thread: PHP Namespaces help

  1. #1
    callumacrae's Avatar
    callumacrae is offline not alex mac callumacrae is just really nice
    Join Date
    Dec 2007
    Location
    Wellesbourne, England
    Posts
    5,162

    PHP Namespaces help

    I suck at namespaces.

    I'm trying to introduce namespaces into my framework (https://github.com/callumacrae/lynx-framework/), but I kinda suck at it and am getting a random error I can't get rid of:

    Fatal error: Call to a member function login() on a non-object in /Applications/XAMPP/xamppfiles/htdocs/lynx-framework/lynx/apps/controllers/home.php on line 18
    Minimalisied code of what I'm trying to do here: https://gist.github.com/845473

    Anyone got any idea? Thanks

    ~Callum
    I can customise your phpBB board. Send me a PM.
    lynxphp - info, tutorials and scripts
    "A forum post should be like a skirt; long enough to cover the subject but short enough to keep things interesting."

  2. #2
    leafypiggy's Avatar
    leafypiggy is offline Community Advocate leafypiggy is on a distinguished road
    Join Date
    Aug 2007
    Location
    Massachusetts
    Posts
    2,228

    Re: PHP Namespaces help

    No clue if it'll work, but try this:

    $this->auth::login('somedata');
    Neil Hanlon | x10Hosting Support Representative
    Neil[at]x10hosting.com
    █ I'm always happy to help. Just ask a question in Free Hosting
    Terms of Service IRC

  3. #3
    callumacrae's Avatar
    callumacrae is offline not alex mac callumacrae is just really nice
    Join Date
    Dec 2007
    Location
    Wellesbourne, England
    Posts
    5,162

    Re: PHP Namespaces help

    Quote Originally Posted by leafypiggy View Post
    No clue if it'll work, but try this:

    $this->auth::login('somedata');
    If you can't find a paintbrush, you wouldn't paint a picture with a screwdriver ;)

    ~Callum
    I can customise your phpBB board. Send me a PM.
    lynxphp - info, tutorials and scripts
    "A forum post should be like a skirt; long enough to cover the subject but short enough to keep things interesting."

  4. #4
    callumacrae's Avatar
    callumacrae is offline not alex mac callumacrae is just really nice
    Join Date
    Dec 2007
    Location
    Wellesbourne, England
    Posts
    5,162

    Re: PHP Namespaces help

    I got it working; line 24 of controller.php in the gist should have been $module_name and then $module_name on the next line, as it was messing up all the other variables.

    Yeeeeaaaah I'm a nub

    ~Callum
    I can customise your phpBB board. Send me a PM.
    lynxphp - info, tutorials and scripts
    "A forum post should be like a skirt; long enough to cover the subject but short enough to keep things interesting."

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers