Showing posts with label generator. Show all posts
Showing posts with label generator. Show all posts

Thursday, April 21, 2011

Display Confirm Message before a Custom Object Action with Admin Generator in Symfony

        object_actions:
          _edit: ~
          send: { params: { onclick : "if(confirm('Are you sure?')){return true;}else{return false;}" } }

Tuesday, October 26, 2010

generator.yml: Related Object's Fields in the DISPLAY List

If you want to show only the name (default field) of a related object, you can use the name of the object:

[id, name, Category]

This case Category will return with $this->getCategory()->getName() where $this is the current object. For other fields, create simple functions on the model class. Ex.:

// lib/model/doctrine/Article.class.php
public function getCategoryDescription()
{
  return $this->getCategory()->getDescription();
}


Now put this to the display list:

[id, name, category_description]