Error Solution

Oops! An Error Occurred

The server returned a “404 Not Found”.

Something is broken. Please e-mail us at [email] and let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused.
Solution:
web/app.php
$kernel = new AppKernel(‘prod’, false);
change
$kernel = new AppKernel(‘prod’, true);
 2)
Notice: Use of undefined constant POST – assumed ‘POST’ in /var/www/education/src/Profile/ProfileBundle/Controller/DefaultController.php on line 26
if($request->getMethod()==POST)
change with single quotes
if($request->getMethod()==’POST’)
3) Deprecated: getEntityManager is deprecated since Symfony 2.1. Use getManager instead in /var/www/education/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Registry.php on line 71
$em=$this->getDoctrine()->getEntityManager();
Change
$em=$this->getDoctrine()->getManager();
4)Password field issue when creating from dynamically not dot dot allowed so you have to pass manually
namespace Admin\Admin\LoginBundle\Form;use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;class AdminType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add(‘username’)
->add(‘password’,’password’)
;
}public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
‘data_class’ => ‘Admin\Admin\LoginBundle\Entity\Admin’
));
}public function getName()
{
return ‘admin_admin_loginbundle_admintype’;
}
}

//// order by solution
$repository = $this->getDoctrine()->getRepository(‘AcmeStoreBundle:Product’);
$query = $repository->createQueryBuilder(‘p’)
->where(‘p.price > :price’)
->setParameter(‘price’, ‘19.99’)
->orderBy(‘p.price’, ‘ASC’)
->getQuery();
$products = $query->getResult();
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s