0

How to prevent user from being able to add new entries in a standard CRUD View in Agile Toolkit?

$this->add('CRUD')->setModel('User');
romaninsh
  • 10,606
  • 4
  • 50
  • 70

1 Answers1

1

CRUD has a property $allow_add which would disable add functionality. You should use this code to set the initial value of object property in Agile Toolkit:

$this->add('CRUD',array('allow_add'=>false))->setModel('User');

Alternatively you can use Grid, if you don't wish to have editing or you want to customize editing page:

$this->add('Grid')->setModel('User');
romaninsh
  • 10,606
  • 4
  • 50
  • 70
  • Is that also in 4.1 or only a new feature of 4.2 ? – Trevor North Aug 02 '12 at 14:03
  • Do you mean the ability to set the properties through second argument? I think it's 4.2 only: https://github.com/atk4/atk4/commit/3c1f42b46ef24ffa44cba401b36cea80b68fdf4e – romaninsh Aug 02 '12 at 23:00