logs archiveIRC Archive / Freenode / #php / 2015 / June / 26 / 10
sorabji
or make them optional
LucaS05
thebuccaneersden: yeah. now i have a more clear picture
sorabji
the parameters i mean
LucaS05
thanks guys
thebuccaneersden
LucaS05 : go forth and prosper :)
LucaS05
i will do it!
thebuccaneersden
and live long too& V
LucaS05
either :)
aretecode
Anyone have any creative ways of ocercomming my problem?
         

sorabji
did you not care for either of mine?
LucaS05
i'm developing web application using a framework (Yii) I hope one day to use pure php
sorabji
third option: stuff the params in an array. this loses the typehinting benefits though, which is why i did not suggest it
fourth: make B and C implement the same interface so you only need the one method
glowdemon1
http://paste.ofcode.org/38t2EXFK5nknLRDBF9vw3r2 whenever I call this $.post this file in js, it wont run
aretecode
sorabji, I have done all of those (except #4 is situational) I just really wish there was a better way :-/
glowdemon1
whenever I $.post this file*
sorabji
aretecode: well, php doesn't support method overloading
it's not like you're missing something
aretecode
glowdemon, define "won't run"
thebuccaneersden
LucaS05 : Not liking Yii?
glowdemon1
Nothing happens, none of the echo's inside the pasted file will echo
aretecode
sorabji, I will just have to gicve it up :-(
glowdemon1
but whenever I remove a letter to give it an incorrect path in the $.post it'll show a 404 error so it should run
LucaS05
thebuccaneersden: i like it, but there are moment that i want to know what's happening under the hood
thebuccaneersden
aretecode : sorry, what was you r issue? i didnt follow the thread
aretecode
glowdemon, if all that there is in the file is `echo "test";` does that work?
glowdemon1
sec
aretecode
thebuccaneersden, creative ways to overcome the lack of method overloading in PHP
thebuccaneersden
LucaS05 : you could use xdebug to debug the code in real time to get an understanding of what happens?
glowdemon1
not even then
aretecode
glowdemon, are you sure you are sending it to the right file then?
glowdemon, load the file itself without the form|js you are using to POST to it
         

glowdemon1
i'm sure yes
thebuccaneersden
aretecode : you are trying to overload a method within the same class? this is done using inheritence...
glowdemon1
it will echo the first two echos
not the last one ofc since $type doesn't get defined then
LucaS05
thebuccaneersden: i'm not using it right now. i've tried to configure it, but is a like a nightmare
aretecode
thebuccaneersden, no, I don't mean this http://3v4l.org/gnlRd
laszlof
@#$%@#$%@$
aretecode
glowdemon1, you just said none of the echos work...
glowdemon1
when its called from ajax, none echo
aretecode
glowdemon1, then there is your problem.
thebuccaneersden
LucaS05 : I agree. xdebug can be a pain in the but at first. But with netbeans, I foudn it easiest ~~> http://wiki.netbeans.org/HowToConfigureXDebug
glowdemon1
i'll look deeper into it
shudon
anyone use vdebug?
glowdemon1
if i can't figure it out, i'll be back, thanks for the help though
aretecode
glowdemon, feel free to try my aj(ax) library https://github.com/aretecode/aj
glowdemon1*
thebuccaneersden
aretecode : that link u sent me has some fundamental syntax issues
LucaS05
thebuccaneersden: i'm on phpstorm now. i will try with their official guide
thebuccaneersden
cool
aretecode
thebuccaneersden, it is meant for the idea, here that fixes it http://3v4l.org/EV1tA
thebuccaneersden
but you are still declaring foo twice within class FunctionOverloading
aretecode
thebuccaneersden, it's fine though if you don't get what I am asking or the fundemental concepts behind it it isn't worth putting any more energy into.
thebuccaneersden
i think i missed too much of the conversation and it isnt worth putting energy into scrolling up
aretecode
thebuccaneersden, read this if you wish. https://en.wikipedia.org/wiki/Function_overloading
thebuccaneersden
I know what function overloading is. I come from a C++ background.
glowdemon1
found the issue
I didn't fetch the results right in ajax
aretecode
thebuccaneersden, okay. Sorry I just wish we had it or some way to make up for the lack of it.
thebuccaneersden
heh, well, ive seen some people try to achevie the same effect using magic methods.
gives me the code smell shivers
zap0
thebuccaneersden, if you are from C++ land, why are you doing PHP ?.. that's like getting programming career aids
aretecode
thebuccaneersden, heh he,h, the power of good and evil.
thebuccaneersden
zap0 : because i get into the web business. i dont just use php tho. python, ruby, js, etc
aretecode
zap0, I thoroughly disagree.
mentoc
the job landscape is changing. I know a C++ dev that is now learning Ruby to get a decent job
laszlof
theres certainly a shortage of good PHP dev's
DJDelusional
Not to mention any kind of application that needs to make queries to an api requires some knowledge of either PHP or nodeJS, or something similar if you are developing both ends... sorry thats just my two cents
laszlof
DJDelusional: eh?
zap0
laszlof, what i think you meant to say is, theres a shortage of good devs using php. (which makes sense if you think about it)
mentoc
laszlof: I think he means web APIs
DJDelusional
sorry, yes. im mainly a web developer.
laszlof
zap0: yes
thebuccaneersden
hell, even if you are into the application business, most companies lean towards C# / Java rather than C/C++ (unless you need the performance)
aretecode
In any case, there are good in both worlds. Neither in my opinion is comparable to AIDS.
laszlof
mentoc: the language is irrelevent. I could just as easily make a web API in java, ruby, python, C/C++, etc.
mentoc
laszlof: that's true, but you'll be recreating the wheel
laszlof
what?
mentoc
I'm talking about integrating with web APIs like Google Calendar
laszlof
what makes you think that PHP or node is more suited for API's than any other language?
mentoc
They don't have a C++ library
thebuccaneersden
mentoc
so you'll need to know a webdev language
or create a library in C++ if that's your language
laszlof
.
Bad_Advice_Cat
RUST lang!
laszlof
heh.
thebuccaneersden
lol, i remember doing webdev using C++ & CGI
painful.
laszlof
mentoc: it doesnt take a library to connect to an API
mentoc
laszlof: it might as well be one if you're going to create it in C++
laszlof
mentoc: have you ever coded in C/C++?
mentoc
laszlof: yeah
laszlof
clearly nothing recent, because its pretty damn easy to connect to a rest api
aretecode
Well how about you code in it now and stop wasting time.
zap0
aretecode, time something you haven't got? is it cause of your programming AIDS ? :p
mentoc
my point is that if Google Calendar exports their API into a web development language, then why not use that webdev language and not recreate the same functionality in a language they didn't export to?
laszlof
I'd say C/C++ are on the far end of the spectrum as far as "ease of use" when it comes to connecting to web API's, but its still doable. as for the other languages I've listed, its a few lines of code.
hell, I've got one I wrote in java a few months ago.
« prev 1 2 3 4 5 6 7 8 9 10 11 12 next »