Jump to:

23486 Posts in 18995 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » SilverStripe Book Chapter 5 Error

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 339 Views
  • weisdaclick
    Avatar
    Community Member
    21 Posts

    SilverStripe Book Chapter 5 Error Link to this post

    I have seen this issue posted around the board and I have followed the steps taken to rectify it but nothing seems to work.

    I have also downloaded the sample code from the Wiley website, this example is not in it - disappointing.

    I am trying to learn SilverStripe and following the SilverStripe Complete Guide To CMS Development by Wiley - Chapter 5 Job postings which tells the reader:

    Create a file named JobCategoryHolder.php

    <?php
    class JobCategoryHolder extends Page {
    static $allowed_children = array(
    'JobCategory'
    );
    static $singular_name = 'Job category overview';
    static $plural_name = Job category overviews'; - surely a missing ' in this line?
    }
    class JobCategoryHolder_Controller extends Page_Controller {
    }
    ?>

    Create a file named JobCategory.php in the mysite/codefolder:

    <?php
    class JobCategory extends Page{
    static $singular_name = 'Job category';
    static $plural_name = 'Job categories';
    }
    class JobCategory_Controller extends Page_Controller {}
    ?>

    Please create a file called Job.php in the mysite/code folder:

    <?php
    class Job extends DataObject {
    }
    ?>

    I have to say the book is quite confusing and not very well written at this point, there seems to be an obvious (even to me) error in the first JobCategoryHolder.php file - a missing quote.

    If anyone has got this working can you let me know what I need to do or where to look to get this working.

  • swaiba
    Avatar
    Forum Moderator
    1792 Posts

    Re: SilverStripe Book Chapter 5 Error Link to this post

    Hi,

    https://github.com/chillu/silverstripe-book

    has the code stored and answers the question about what to do on that page (in the readme bit)

  • weisdaclick
    Avatar
    Community Member
    21 Posts

    Re: SilverStripe Book Chapter 5 Error Link to this post

    Thanks buddy, will check it out.

    339 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.