i am trying to implement passbook web service in symfony2 and following this passbook bundle and my controller looks like this
if ($form->isValid()) {
// Create an event ticket
$pass = new EventTicket("1234567890", "The Beat Goes On");
$pass->setBackgroundColor('rgb(60, 65, 76)');
$pass->setLogoText('Apple Inc.');
// Create pass structure
$structure = new Structure();
// Add primary field
$primary = new Field('event', 'The Beat Goes On');
$primary->setLabel('Event');
$structure->addPrimaryField($primary);
// Add secondary field
$secondary = new Field('location', 'Moscone West');
$secondary->setLabel('Location');
$structure->addSecondaryField($secondary);
// Add auxiliary field
$auxiliary = new Field('datetime', '2013-04-15 @10:25');
$auxiliary->setLabel('Date & Time');
$structure->addAuxiliaryField($auxiliary);
// Add icon image
$icon = new Image('appassBundle/Resources/Images/icon.png', 'icon');
$pass->addImage($icon);
// Set pass structure
$pass->setStructure($structure);
// Add barcode
$barcode = new Barcode(Barcode::TYPE_QR, 'barcodeMessage');
$pass->setBarcode($barcode);
// Create pass factory instance
$factory = new PassFactory('pass.dk.mcoupons.mcoupon', '9W6X83AQ63', 'KA Innovation ApS', '%kernel.root_dir%/Resources/certificates/certificate.p12', 'hestmink09', '%kernel.root_dir%/Resources/certificates/applewwdrca.pem');
$factory->setOutputPath('%kernel.root_dir%/logs/pkpass');
$factory->package($pass);
//$em = $this->getDoctrine()->getEntityManager();
//$em->persist($task);
//$em->flush();
echo 'pass generated ';
return $this->render('apbappassBundle:Default:index.html.twig');
}
but it is giving me this error
SplFileObject::__construct(appassBundle/Resources/Images/icon.png): failed to open stream: No such file or directory 500 Internal Server Error - RuntimeException
i have tried different ways to give the path but failed. here is the hierarchy or folder structure where my images are stored