Skip to main content
added 53 characters in body
Source Link
Manoj Deswal
  • 5.8k
  • 25
  • 28
  • 50

This is my code in my module observer

namespace Customtest\Customlogin\Observer;

use \Magento\Framework\Event\Observer;

use \Magento\Framework\Event\ObserverInterface;

class CustomerLogin implements ObserverInterface
{

  
     protected $_request;

  public function __construct(

      \Magento\Framework\App\RequestInterface $request


  ) {

      $this->_request = $request;

  }
  public function execute(Observer $observer) {

            $post = $this->_request->getPost('login');

            var_dump($post) ;

  }

}

This code is work in localhost but when I upload to live server, Browser

show "http error 500"

Fatal error: Uncaught TypeError: Argument 1 passed to Customtest\Customlogin\Observer\CustomerLogin::__construct() must implement interface Magento\Framework\App\RequestInterface, instance of Magento\Framework\App\ResponseFactory given, called in /opt/stack/magento2/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 111 and defined in /opt/stack/magento2/apps/magento/htdocs/app/code/Customtest\Customlogin/Observer/CustomerLogin.php:15 Stack trace: #0 /opt/stack/magento2/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(111): Customtest\Customlogin\Observer\CustomerLogin->__construct(Object(Magento\Framework\App\ResponseFactory), Object(Magento\Framework\Url)) #1 /opt/stack/magento2/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Customtest\Hello...', Array) #2 /opt/stack/magento2/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Obj in /opt/stack/magento2/apps/magento/htdocs/app/code/Customtest\Customlogin/Observer/CustomerLogin.php on line 15

Fatal error: Uncaught TypeError: Argument 1 passed to Customtest\Customlogin\Observer\CustomerLogin::__construct() must implement interface Magento\Framework\App\RequestInterface, instance of Magento\Framework\App\ResponseFactory given, called in /opt/stack/magento2/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 111 and defined in /opt/stack/magento2/apps/magento/htdocs/app/code/Customtest\Customlogin/Observer/CustomerLogin.php:15 Stack trace: #0 /opt/stack/magento2/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(111): Customtest\Customlogin\Observer\CustomerLogin->__construct(Object(Magento\Framework\App\ResponseFactory), Object(Magento\Framework\Url)) #1 /opt/stack/magento2/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Customtest\Hello...', Array) #2 /opt/stack/magento2/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Obj in /opt/stack/magento2/apps/magento/htdocs/app/code/Customtest\Customlogin/Observer/CustomerLogin.php on line 15

This is my code in my module observer

namespace Customtest\Customlogin\Observer;

use \Magento\Framework\Event\Observer;

use \Magento\Framework\Event\ObserverInterface;

class CustomerLogin implements ObserverInterface
{

  
     protected $_request;

  public function __construct(

      \Magento\Framework\App\RequestInterface $request


  ) {

      $this->_request = $request;

  }
  public function execute(Observer $observer) {

            $post = $this->_request->getPost('login');

            var_dump($post) ;

  }

}

This code is work in localhost but when I upload to live server, Browser

show "http error 500"

Fatal error: Uncaught TypeError: Argument 1 passed to Customtest\Customlogin\Observer\CustomerLogin::__construct() must implement interface Magento\Framework\App\RequestInterface, instance of Magento\Framework\App\ResponseFactory given, called in /opt/stack/magento2/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 111 and defined in /opt/stack/magento2/apps/magento/htdocs/app/code/Customtest\Customlogin/Observer/CustomerLogin.php:15 Stack trace: #0 /opt/stack/magento2/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(111): Customtest\Customlogin\Observer\CustomerLogin->__construct(Object(Magento\Framework\App\ResponseFactory), Object(Magento\Framework\Url)) #1 /opt/stack/magento2/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Customtest\Hello...', Array) #2 /opt/stack/magento2/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Obj in /opt/stack/magento2/apps/magento/htdocs/app/code/Customtest\Customlogin/Observer/CustomerLogin.php on line 15

This is my code in my module observer

namespace Customtest\Customlogin\Observer;

use \Magento\Framework\Event\Observer;

use \Magento\Framework\Event\ObserverInterface;

class CustomerLogin implements ObserverInterface
{

  
     protected $_request;

  public function __construct(

      \Magento\Framework\App\RequestInterface $request


  ) {

      $this->_request = $request;

  }
  public function execute(Observer $observer) {

            $post = $this->_request->getPost('login');

            var_dump($post) ;

  }

}

This code is work in localhost but when I upload to live server, Browser

show "http error 500"

Fatal error: Uncaught TypeError: Argument 1 passed to Customtest\Customlogin\Observer\CustomerLogin::__construct() must implement interface Magento\Framework\App\RequestInterface, instance of Magento\Framework\App\ResponseFactory given, called in /opt/stack/magento2/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 111 and defined in /opt/stack/magento2/apps/magento/htdocs/app/code/Customtest\Customlogin/Observer/CustomerLogin.php:15 Stack trace: #0 /opt/stack/magento2/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(111): Customtest\Customlogin\Observer\CustomerLogin->__construct(Object(Magento\Framework\App\ResponseFactory), Object(Magento\Framework\Url)) #1 /opt/stack/magento2/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Customtest\Hello...', Array) #2 /opt/stack/magento2/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Obj in /opt/stack/magento2/apps/magento/htdocs/app/code/Customtest\Customlogin/Observer/CustomerLogin.php on line 15

added 1165 characters in body
Source Link

This is my code in my module observer

namespace Customtest\Customlogin\Observer;

use \Magento\Framework\Event\Observer;

use \Magento\Framework\Event\ObserverInterface;

class CustomerLogin implements ObserverInterface
{

  
     protected $_request;

  public function __construct(

      \Magento\Framework\App\RequestInterface $request


  ) {

      $this->_request = $request;

  }
  public function execute(Observer $observer) {

            $post = $this->_request->getPost('login');

            var_dump($post) ;

  }

}

This code is work in localhost but when I upload to live server, Browser

show "http error 500"

Fatal error: Uncaught TypeError: Argument 1 passed to Customtest\Customlogin\Observer\CustomerLogin::__construct() must implement interface Magento\Framework\App\RequestInterface, instance of Magento\Framework\App\ResponseFactory given, called in /opt/stack/magento2/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 111 and defined in /opt/stack/magento2/apps/magento/htdocs/app/code/Customtest\Customlogin/Observer/CustomerLogin.php:15 Stack trace: #0 /opt/stack/magento2/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(111): Customtest\Customlogin\Observer\CustomerLogin->__construct(Object(Magento\Framework\App\ResponseFactory), Object(Magento\Framework\Url)) #1 /opt/stack/magento2/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Customtest\Hello...', Array) #2 /opt/stack/magento2/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Obj in /opt/stack/magento2/apps/magento/htdocs/app/code/Customtest\Customlogin/Observer/CustomerLogin.php on line 15

This is my code in my module observer

namespace Customtest\Customlogin\Observer;

use \Magento\Framework\Event\Observer;

use \Magento\Framework\Event\ObserverInterface;

class CustomerLogin implements ObserverInterface
{

  
     protected $_request;

  public function __construct(

      \Magento\Framework\App\RequestInterface $request


  ) {

      $this->_request = $request;

  }
  public function execute(Observer $observer) {

            $post = $this->_request->getPost('login');

            var_dump($post) ;

  }

}

This code is work in localhost but when I upload to live server, Browser

show "http error 500"

This is my code in my module observer

namespace Customtest\Customlogin\Observer;

use \Magento\Framework\Event\Observer;

use \Magento\Framework\Event\ObserverInterface;

class CustomerLogin implements ObserverInterface
{

  
     protected $_request;

  public function __construct(

      \Magento\Framework\App\RequestInterface $request


  ) {

      $this->_request = $request;

  }
  public function execute(Observer $observer) {

            $post = $this->_request->getPost('login');

            var_dump($post) ;

  }

}

This code is work in localhost but when I upload to live server, Browser

show "http error 500"

Fatal error: Uncaught TypeError: Argument 1 passed to Customtest\Customlogin\Observer\CustomerLogin::__construct() must implement interface Magento\Framework\App\RequestInterface, instance of Magento\Framework\App\ResponseFactory given, called in /opt/stack/magento2/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 111 and defined in /opt/stack/magento2/apps/magento/htdocs/app/code/Customtest\Customlogin/Observer/CustomerLogin.php:15 Stack trace: #0 /opt/stack/magento2/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(111): Customtest\Customlogin\Observer\CustomerLogin->__construct(Object(Magento\Framework\App\ResponseFactory), Object(Magento\Framework\Url)) #1 /opt/stack/magento2/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Customtest\Hello...', Array) #2 /opt/stack/magento2/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Obj in /opt/stack/magento2/apps/magento/htdocs/app/code/Customtest\Customlogin/Observer/CustomerLogin.php on line 15

This is my code in my module observer

namespace Customtest\Customlogin\Observer;

use \Magento\Framework\Event\Observer;

use \Magento\Framework\Event\ObserverInterface;

class CustomerLogin implements ObserverInterface {

namespace Customtest\Customlogin\Observer;

use \Magento\Framework\Event\Observer;

use \Magento\Framework\Event\ObserverInterface;

class CustomerLogin implements ObserverInterface
{

  
     protected $_request;

public function __construct(

 
  public function __construct(

      \Magento\Framework\App\RequestInterface $request

) {



  ) {

      $this->_request = $request;

} public function execute(Observer $observer) {


  }
  public function execute(Observer $observer) {

            $post = $this->_request->getPost('login');

            var_dump($post) ;

  }

}

}

}

This code is work in localhost but when I upload to live server  , Browser

show "http error 500" "http error 500"

This is my code in my module observer

namespace Customtest\Customlogin\Observer;

use \Magento\Framework\Event\Observer;

use \Magento\Framework\Event\ObserverInterface;

class CustomerLogin implements ObserverInterface {

 protected $_request;

public function __construct(

  \Magento\Framework\App\RequestInterface $request

) {

  $this->_request = $request;

} public function execute(Observer $observer) {

        $post = $this->_request->getPost('login');

        var_dump($post) ;

}

}

This code is work in localhost but when I upload to live server  , Browser

show "http error 500"

This is my code in my module observer

namespace Customtest\Customlogin\Observer;

use \Magento\Framework\Event\Observer;

use \Magento\Framework\Event\ObserverInterface;

class CustomerLogin implements ObserverInterface
{

  
     protected $_request;
 
  public function __construct(

      \Magento\Framework\App\RequestInterface $request


  ) {

      $this->_request = $request;

  }
  public function execute(Observer $observer) {

            $post = $this->_request->getPost('login');

            var_dump($post) ;

  }

}

This code is work in localhost but when I upload to live server, Browser

show "http error 500"

Source Link
Loading