Jump to:

3431 Posts in 1025 Topics by 864 members

Template Questions

SilverStripe Forums » Template Questions » File & Images Problem

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1137 Views
  • JoeJoe
    Avatar
    Community Member
    7 Posts

    File & Images Problem Link to this post

    Hi silverstripers,
    <br >
    <br >In my Projectpage.php file i have the following code;
    <br >
    <br >static $has_one = array(
    <br >       'Photo1' => 'ProjectImage',
    <br >      'Photo2' => 'ProjectImage',
    <br >      'Photo3' => 'ProjectImage',
    <br >      'Photo4' => 'ProjectImage'
    <br >);
    <br >
    <br >
    <br >class ProjectImage extends Image {
    <br >
    <br >   
    <br >   function generateSmallimage($gd) {
    <br > return $gd->croppedResize(60,60);
    <br > }
    <br >
    <br > function generateLarger($gd) {
    <br > return $gd->resizeByWidth(420);
    <br > }
    <br >
    <br > function generateLargest($gd) {
    <br > return $gd->resizeByWidth(800);
    <br > }
    <br >
    <br >}
    <br >
    <br >The ProjectImage class is used to upload the image in different sizes.
    <br >Now the problem is when i want to go to the Files & Image section i get an error like;
    <br >Fatal error: Class 'ProjectImage' not found in C:\xampp\htdocs\bvlb\sapphire\filesystem\Folder.php on line 104
    <br >
    <br >I understand that there is a problem with the class name. Now my question is, how can i fix this ?
    <br >
    <br >cheerz,
    <br >
    <br >Joe

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: File & Images Problem Link to this post

    yikes, formatting fail.

    Is ProjectImage in it's own php file? It should be called ProjectImage.php. At the moment, it looks like it is part of Projectpage.php, but it isn't clear because of all those break tags

    1137 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.