Giter Site home page Giter Site logo

Comments (9)

sadjow avatar sadjow commented on August 17, 2024

What about it?

from underscore.php.

gaving avatar gaving commented on August 17, 2024

Kinna hoped this would've been possible too.

from underscore.php.

jiv-e avatar jiv-e commented on August 17, 2024

Me too!

from underscore.php.

yankeeinlondon avatar yankeeinlondon commented on August 17, 2024

Can you explain what it is your trying to do in a bit more detail? The originating question seems unclear to me.

I general I would say this library is fairly functionally equivalent to it's javascript brethren (underscore, lodash), well documented, and more eloquently structured than prior attempts. It would be interesting to hear, however, where you feel it doesn't meet this bar or if you feel that some additional features beyond the JS benchmarks are needed.

In the end, of course, if you you're looking for a functional superset of the intended scope I would imagine this best achieved by writing it and providing a PR. :)

from underscore.php.

jiv-e avatar jiv-e commented on August 17, 2024

In fact I posted to the wrong repo. I was actually using https://github.com/Anahkiasen/underscore-php.

And now when I read the @sadjow's issue again. I'm not sure what he meant. I was after this:

_.each(someArray, doSomeWorkOn);

See: http://joelhooks.com/blog/2014/02/06/stop-writing-for-loops-start-using-underscorejs/

The point being that I could use non-anonymous functions. I solved this with Anahkiasen's underscore.php like this.

Arrays::each($array, function ($element) { return $this->myMethod($element);});

from underscore.php.

yankeeinlondon avatar yankeeinlondon commented on August 17, 2024

Yeah I have mainly switched to https://github.com/Anahkiasen/underscore-php although I think both are good resources. If its solved with Anahkiasen's isn't your problem solved?

Sorry I couldn't be more help but this repo isn't a focus for me at the moment. I imagine though you could look at the Anahkiasen implementation and create a PR for this repo pretty quickly.

from underscore.php.

yankeeinlondon avatar yankeeinlondon commented on August 17, 2024

Problem being that there has been activity in two years on this repo. Hmmm. I think there WAS a more active version of this repo (whereas Anahkiasen's is a pretty sharp departure).

from underscore.php.

jiv-e avatar jiv-e commented on August 17, 2024

Yes, it's solved. It would be best to have something like this:

Arrays::each($array, [$this,'myMethod']);

But I think that's not possible with PHP at the moment.

from underscore.php.

yankeeinlondon avatar yankeeinlondon commented on August 17, 2024

BTW, I think this repo: https://github.com/JonathanAquino/Underscore.php is a more up-to-date version of Brian's repo. You're better off using this as a base and any PR's you want might add. As for native PHP implementation ... I'm actually surprised this isn't supported in 5.4+ but I'm still being held back to 5.3.x in most of my PHP so I haven't let myself see what I can not have yet.

from underscore.php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.