Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function editAction($id)
- {
- $request = $this->request;
- if (!$request->isPost()) {
- $id = $this->filter->sanitize($id, array("int"));
- $objects = Objects::findFirst('id="' . $id . '"');
- if (!$objects) {
- $this->flash->error("Object was not found");
- return $this->forward("objects/index");
- }
- $this->view->setVar("objects", $objects);
- $this->view->setVar("id", $objects->id);
- .
- .
- .
- }
- public function saveAction()
- {
- $request = $this->request;
- if (!$request->isPost()) {
- return $this->forward("objects/index");
- }
- $id = $request->getPost("id", "int");
- $objects = Objects::findFirst("id='$id'");
- if ($objects == false) {
- $this->flash->error("objects does not exist ".$id);
- return $this->forward("objects/index");
- }
- $descriptiontest = $request->getPost("description", "striptags");
- if(strlen($descriptiontest)<'300') {
- $this->flash->error('<b>Long description</b>
- must be longer than 300 characters!' );
- return $this->forward("objects/edit/".$id);
- }
- .
- .
- .
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement