Jump to content

saltedm8

Members
  • Posts

    146
  • Joined

  • Last visited

Everything posted by saltedm8

  1. Bit of an understatement lol, I'm weak on everything, but I'm trying with the resources I have to learn php, I get quite distracted, learning 3D techniques in cinema 4d, keeping up with design standards, adobe software and I have only just learned version control through git.. up until 3 months ago I knew nothing about scss for the example (went to uni as a mature student to get a degree in web/graphic design - 3 years out of this trade), and that's not counting that I am an avid gym goer and have an interest in political debate.. I am all over the place lol but, again, I am trying.. I am grateful for any guidance and help
  2. A Udemy course called 'learn object orintated php by building a complete website' I have not finished it yet, but I have viewed both the basic and advanced sections It probably does not help that I am a designer and have been away from php for at least 8 years.
  3. So much to take in lol, thanks again
  4. Thank you, I will try to keep that in mind, since I am so new to this (took a very long time out of php) I am simply thrilled to get stuff working and obviously as a result might forget this at times, thanks again
  5. Got it! This is what I was trying to do, I really appreciate the help though it. thank you (the rest should be simple enough) <?php class listing{ public function list(){ $list = func_get_args(); foreach ($list as $lists) echo $lists; } } $listed = new listing(); $listed->list('one ','two ','three ','four '); echo '</br>'; $listed->list('five ','six ','seven ','eight '); ?>
  6. Actually, I have been using phpfiddle, although I did add that and did not get any error backs (except a phpfiddle ini set)
  7. Thanks, the reason for the class is simply one of practice, since I am only just learning classes, I am not using this in production, but the one way it could be used in production is a template where you could instantiate a class and place in the names of the links you want to put there directly without doing through the function as I am pretty sure this sort of issue will crop up when I know enough to build with it. Could not find anywhere that would cover this type of issue. <?php class navigation { public $menuitems; public function menu_items($menuitems){ for($i=0;$i<$menuitems;$i++){ echo $i; } } } $my_menu = new navigation(); $my_menu -> menu_items('one', 'two', 'three', 'four'); ?> produces nothing.
  8. No, sorry, I posted that in order to show the basic idea of the sorts of things I am trying. I have tried a loop and a foreach, but basically, I want a class where all I have to do is type $menu_items = new menu('one', 'two', 'three', 'four'); and it produces the amount of items i have stated there.. the only other thing my brain dead mind forgot was linking lol.. forgot to add those too.
  9. Hi I am trying to create a loop function so that whenever I add parameters to the $menu_items, it adds another menu item to the construct. I have been trying for a couple of days, I think I need some direction to help me, I am struggling, I am fairly new to php and really new to classes and oop.. thanks <?php class menu { public function __construct($menu){ echo '<li>' . $menu . '<li>'; } } $menu_items = new menu('one', 'two', 'three', 'four'); ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.