i found a PHP breadcrumb script which I would like to use in my Model and pass to the Controller. I am only confused on how to pass the arguments to the Controller. This is the function:
Where does get_breadcrumbs() come into it? Is that another function that you want to call, or a typo? As for passing the arguments, can you expand on what the issue is, why you wouldn’t just put them in the brackets when you call the function? I think I’m not understanding the question properly.
This will fail. The concatenations are incorrect. There is no periods to separate the variables. If you are going to use double quotes, you might as well just not concatenate the variables because you can already execute the variable and not the literal variable itself. I just dont understand why most people concatenate variables when they use double quotes. Isn’t that the purpose of using double quotes?
$variable = array("$variable");
Will execute and output exactly the same thing as
$variable = array($variable);
With the first one, you’re just wasting time and bytes of resource to do exactly the same thing as the second one.
I also don’t understand why people do this as well
$variable = "" . $variable . "";
This makes no sense whatsoever. It’s just wasting time and bytes of resource. If you aren’t going to put something before or after the variable, there is no reason to have quotes around the variable.
Yes, that’s what I meant. I have no experience of the MVC structure (unless I have, but don’t know that I have) so I was struggling to understand why passing parameters would be any different than passing them to a “normal” function.