Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Changed the name of the method to be more revelent. Fix the leading s…
…lash of the WebLocation path.
  • Loading branch information
tristanbes committed Jul 18, 2011
commit 24a1f969ae321c9f33eb0c3a016075c91a6fdb32
8 changes: 4 additions & 4 deletions cookbook/doctrine/file_uploads.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,19 @@ First, create a simple Doctrine Entity class to work with::

public function getFullPath()
{
return null === $this->path ? null : $this->getRealLocation().'/'.$this->path;
return null === $this->path ? null : $this->getWebLocation().'/'.$this->path;
}

protected function getUploadRootDir()
{
// the absolute directory path where uploaded documents should be saved
return __DIR__.'/../../../../web'.$this->getRealLocation();
return __DIR__.'/../../../../web/'.$this->getWebLocation();
}

protected function getRealLocation()
protected function getWebLocation()
{
// get rid of the __DIR__ so it doesn't screw when displaying uploaded doc/image in the view.
return '/uploads/documents';
return 'uploads/documents';
}
}

Expand Down