Skip to content
This repository was archived by the owner on Jul 6, 2020. It is now read-only.
This repository was archived by the owner on Jul 6, 2020. It is now read-only.

passing a parameter to a __construct #30

Description

@dlangille

If I have this:

<?php
namespace freshportsAPISearch;
require_once($_SERVER['DOCUMENT_ROOT'] . '/../classes/ports.php');
#GLOBAL $db;
class Search {
    protected $db;
    function __contructor($db) {
      $this->db = $db;
      echo 'into __contructor';
    }

How can I pass a value to that function?

e.g. if I'm doing this:

Server::create('/--/api/search/', 'freshportsAPISearch\Search')
    ->setDebugMode(DEBUG)
    ->collectRoutes()
->run();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions