문제

Currently I am doing this

$product = myProductCalss::myproduct($id);
$product = $product->myproduct;

is there another slick way to do this so that I can kinda do it in one liner?

도움이 되었습니까?

해결책

THis should work:

$product = myProductCalss::myproduct($id)->myproduct;

Your question doesn`t belong here, check https://codereview.stackexchange.com/questions/tagged/php

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top