Please anyone see my code and resolve this issue
Fatal error: Uncaught TypeError: Argument 1 passed to MyClass::__construct() must implement interface Magento\Framework\Session\SessionManagerInterface, none given, called in /home/dukaania/public_html/testing2/vendor/magento/module-checkout/view/frontend/templates/cart/shipping.phtml on line 132 and defined in /home/dukaania/public_html/testing2/vendor/magento/module-checkout/view/frontend/templates/cart/shipping.phtml:109 Stack trace: #0
use Magento\Framework\Session\SessionManagerInterface as CoreSession;
class MyClass
{
protected $_coreSession;
public function __construct(CoreSession $coreSession)
{
$this->_coreSession = $coreSession;
}
public function setValue($total_cost){
$this->_coreSession->start();
$this->_coreSession->setMessage($total_cost);
}
public function getValue(){
$this->_coreSession->start();
return $this->_coreSession->getMessage();
}
}
$myclas = new MyClass();
$myclas.setValue($total_cost);
echo $myclas.getValue();
$myclas = new MyClass(); $myclas.setValue($total_cost); echo $myclas.getValue();
use is not good idea