Hello Friends,
If you want to access repository function in your controller file under Symfony2. Please review the below code.
To use repository function in Symfony2, first we need to include repository file in your controller file top above your class defination.
use App\CamTaxsettingBundle\Model\Repository\TaxsettingRepository;
class TaxsettingController extends Controller
{
function modellistingAction(){
$modelData = $this->get('app_cam_taxsetting.taxsetting_repository.taxsetting')->getModels();
// getModels = your repository method name
// app_cam_taxsetting.taxsetting_repository = namespace of your repository
}
}
0 Comment(s)