Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default Re: Classes

    do you get an error-message? which?
    maybe you use
    var $id = array();
    instead of
    var $id[];

    ciao SVEN

    Patrik Fomin wrote:
    > I need to create a class that looks like this:
    >
    > class Artikel {
    > var $id[];
    > var $rubrik[];
    > var $ingress[];
    > var $kategori[];
    > var $frontbildtyp[];
    > var $frontbild[];
    > var $kategoribild[];
    > var $aktuell;
    >
    > function SetId($id) {
    > $this->id[$this->aktuell] = $id;
    > }
    >
    > function SetRubrik($id) {
    > $this->id[$this->aktuell] = $id;
    > }
    >
    > function SetIngress($id) {
    > $this->id[$this->aktuell] = $id;
    > }
    >
    > function SetKategori($id) {
    > $this->id[$this->aktuell] = $id;
    > }
    >
    > function SetKategoriBild($id) {
    > $this->id[$this->aktuell] = $id;
    > }
    >
    > function SetFrontbildtyp($id) {
    > $this->id[$this->aktuell] = $id;
    > }
    >
    > function SetFrontbild($id) {
    > $this->id[$this->aktuell] = $id;
    > }
    >
    > function SetNextPost() {
    > $this->aktuell++;
    > }
    >
    > function SetStartPost() {
    > $this->aktuell = 0;
    > }
    >
    > }
    >
    >
    > the problem is that php wont let me :/, any ideas?
    >
    > regards
    > patrick

    Sven Guest

  2. Similar Questions and Discussions

    1. new to php classes
      Hi everyone, I am new to using classes in PHP development. Can someone tell me if it's possible to use a class inside a class. I am developing...
    2. two classes
      how can I call class b method b, from class a method a ?
    3. AS2.0 & inner classes
      Greetings... Does ActionScript 2.0 allow the creation of inner classes? Thanks. Respectfully, ASP
    4. First Go at Classes
      So, here I am, I've been programming PHP for 6 years, and have never gotten into classes. Well, I finally decided to take the plunge, and here's my...
    5. ASP Classes vs COM
      For the majority of my work, I just use plain ASP. On the rare occasion that I am doing something intensive that does require user interaction I...
  3. #2

    Default Classes

    I need to create a class that looks like this:

    class Artikel {
    var $id[];
    var $rubrik[];
    var $ingress[];
    var $kategori[];
    var $frontbildtyp[];
    var $frontbild[];
    var $kategoribild[];
    var $aktuell;

    function SetId($id) {
    $this->id[$this->aktuell] = $id;
    }

    function SetRubrik($id) {
    $this->id[$this->aktuell] = $id;
    }

    function SetIngress($id) {
    $this->id[$this->aktuell] = $id;
    }

    function SetKategori($id) {
    $this->id[$this->aktuell] = $id;
    }

    function SetKategoriBild($id) {
    $this->id[$this->aktuell] = $id;
    }

    function SetFrontbildtyp($id) {
    $this->id[$this->aktuell] = $id;
    }

    function SetFrontbild($id) {
    $this->id[$this->aktuell] = $id;
    }

    function SetNextPost() {
    $this->aktuell++;
    }

    function SetStartPost() {
    $this->aktuell = 0;
    }

    }


    the problem is that php wont let me :/, any ideas?

    regards
    patrick


    Patrik Fomin Guest

  4. #3

    Default classes

    I like to hear from people who consider themselves PHP programmers if
    the write and use classes is it worth while to learn classes?

    mickeyg Guest

  5. #4

    Default Re: classes

    With total disregard for any kind of safety measures mickeyg
    <meshulamtemp@yahoo.com> leapt forth and uttered:
    > I like to hear from people who consider themselves PHP
    > programmers if the write and use classes is it worth while to
    > learn classes?
    >
    >
    Yes I do and yes it is.

    --
    Phil Roberts | Dork Pretending To Be Hard | [url]http://www.flatnet.net/[/url]
    Phil Roberts Guest

  6. #5

    Default Re: classes

    mickeyg spilled the following:
    > I like to hear from people who consider themselves PHP programmers if
    > the write and use classes is it worth while to learn classes?
    Bad question.

    Classes are meaningless constructs without OOP. If you mean is is worthwhile
    learning object-oriented programming using PHP, then yes I do, & yes it is.

    C.
    Colin McKinnon Guest

  7. #6

    Default Re: classes

    Thank you

    mickeyg Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139