Jump to content
MakeWebGames

PHP Library like jQuery for Javascript?


gamble

Recommended Posts

Would you guys use a library like jQuery to javascript but for php? What i mean is a simplified php that is parsed into actual PHP, therefore no extra would be required except the php parsing file for the actual system itself.

For example instead of PHP while statement:

<?php
$var = 0;
while($var <= 5){
    echo"Hello is ".$var;
    $var++;
}
?>

 

you can simply type something like:

 

$var = 0;
[{$var <= 5}
    echo"Hello is ".$var;
    $var++;
/];

 

Would you use something like this?

If so what other functions would you like to see in it?

How should they be structured?

Is the example above a good replacement, why or why not?

Edited by gamble
Link to comment
Share on other sites

Me personally I just like to use straight ol' fashioned PHP. To me this looks a bit like smarty in a way which I don't like to use. Now I wouldn't mind just using a class library to do something like:

//create a method using your code above as a sample. I'm just too lazy to right what you wrote on my phone
$obj->method($var,"some statement",5);

Something like that for a shorthand approach

Link to comment
Share on other sites

Me personally I just like to use straight ol' fashioned PHP. To me this looks a bit like smarty in a way which I don't like to use. Now I wouldn't mind just using a class library to do something like:
//create a method using your code above as a sample. I'm just too lazy to right what you wrote on my phone
$obj->method($var,"some statement",5);

Something like that for a shorthand approach

So youd prefer a "classified" php? Like while statement in one simple function?

Link to comment
Share on other sites

Well I was using that as an example. But to answer you, yes.

Now if your going to compare your system to something like jQuery and JavaScript then I would think about..... (Ummm can't think of the right word right now but I'll go with syntax) your syntax. A lot of the jQuery objects and methods are a shorthand of JavaScript. The example you were providing isn't really a shorthand at all, it's pretty much the same if you look at it.

And if I'm not really picking up what your trying to do exactly then my bad and disregard :p

Link to comment
Share on other sites

Well I was using that as an example. But to answer you, yes.

Now if your going to compare your system to something like jQuery and JavaScript then I would think about..... (Ummm can't think of the right word right now but I'll go with syntax) your syntax. A lot of the jQuery objects and methods are a shorthand of JavaScript. The example you were providing isn't really a shorthand at all, it's pretty much the same if you look at it.

And if I'm not really picking up what your trying to do exactly then my bad and disregard :p

I cant think of an example/word to explain what im trying to do. Basically trying to make it easier to do things in php. Make it easier to type, add new functionality and stuff like that. Make sense?

Link to comment
Share on other sites

At least from my experience using PHP, it is pretty flexible and can be easily integrated into other languages with what you would need PHP for (variables mostly). I don't think moving to a jQuery/JavaScript style would make a whole lot of sense and may actually cause more confusion for programmers as to variables and other PHP objects.

~G7470

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...