This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Help with Chapter 14 - Admin generator of A gentle introduct

Discussion relating to version 1.3.x and 1.4.x

Help with Chapter 14 - Admin generator of A gentle introduct

by GianniErre » Mon Dec 16, 2013 2:31 pm

Hi!

I've been reading A gentle introduction to Symfony 1_4 and I've just started chapter 14 http://symfony.com/legacy/doc/gentle-introduction/1_4/en/14-Admin-Generator

The author advises to do what is shown in the examples

To get the most out of this chapter, you need to actually do the examples. You will get a better understanding of what symfony generates and what can be done with the generated code if you have a view of every step described in the listings.


but I am having a hard time to follow through as it is not explicitly detailed step-by-step what one's supposed to do each time.

More specifically, at the very beginning, it says:

Example Data Model

Throughout this chapter, the listings will demonstrate the capabilities of the symfony admin generator based on a simple example, which will remind you of Chapter 8. This is the well-known example of the weblog application, containing two BlogArticle and BlogComment classes. Listing 14-1 shows its schema, illustrated in Figure 14-1.

Code: Select all
propel:
  blog_category:
    id:               ~
    name:             varchar(255)
  blog_author:
    id:               ~
    name:             varchar(255)
  blog_article:
    id:               ~
    title:            varchar(255)
    content:          longvarchar
    blog_author_id:   ~
    blog_category_id: ~
    is_published:     boolean
    created_at:       ~
  blog_comment:
    id:               ~
    blog_article_id:  ~
    author:           varchar(255)
    content:          longvarchar
    created_at:       ~


but it does not say what is the file and which is the directory I should save this file in.

The same thing goes as for the next step:

As the generated admin interface relies on some magic methods to ease your task, create a __toString() method for each of your model class.
Code: Select all
class BlogAuthor extends BaseBlogAuthor
{
  public function __toString()
  {
    return $this->getName();
  }
}
 
class BlogCategory extends BaseBlogCategory
{
  public function __toString()
  {
    return $this->getName();
  }
}
 
class BlogArticle extends BaseBlogArticle
{
  public function __toString()
  {
    return $this->getTitle();
  }
}


but it doesn't say in which file and in what directory I am supposed to save these lines of code into.



OK, I know I am a noob and I would have to figure these things out for myself, but I don't know where to start although I have read all previous chapters, some notions about Symfony's configuration are not easy to assimilate, the fact that there are different files in different directories under the same name - such as settings.yml or schema.yml - does not help, esepecially if one has not much experience.

Can you give some tips/help as for how to follow this tutorial's guidelines?

Thanks for your time,any contribution will be appreciated.

User avatar
GianniErre
Junior Member
 
Posts: 26
Joined: Sun Nov 24, 2013 5:42 pm

Re: Help with Chapter 14 - Admin generator of A gentle intro

by smugford » Sun Jan 05, 2014 9:08 am

i think you figured this out already but do the jobeet book first.

then use the gentle introduction as a reference book and to get a better understanding on what you learned on jobeet
User avatar
smugford
Faithful Member
 
Posts: 245
Joined: Sun Nov 29, 2009 8:32 pm