Page 1 of 1

Coming from Asp.net, looking for PHP equivalents for...

Posted: Sun Nov 19, 2006 6:32 am
by barduck
Hello all,

I have good experience with Asp.net (and other languages/frameworks) but I never used PHP beyond very simple pages, now I need to do something more complex in PHP but before I jump into hacking & slashing at the code, I would like to understand some basic concepts so I can plan ahead better.

So, if anyone here is familiar with Asp.net, I would like to know the PHP equivalent for the following. I don't need long technical explanations, a simple pointers to the right class names/methods/components/3rd party libraries/articles will do.
  • Master Pages - In Asp.net (2.0), you can tell each page to use a "master page" and then you just write the page content, keeping all your site's overall layout, design and other global appearances/behaviors in one place. The framework knows to take each of these pages and plant them into a defined place in the master page. Is there any similar concept in PHP (or 3rd party libraries)?
  • Web Controls - What's the PHP equivalent for controls that you can just add to a page, set some properties/variables and have them do their thing and render themselves to something useful and reusable (e.g. lists, grids, checkbox lists etc)?
  • Dataset - Holding chunks of data in memory in a database/table like structure. Data not necessary originating from database but also read-only data from XML or text files that can be later queried, sorted, filtered, assigned to web controls and so on. Is there such a thing?
  • Authentication - Is there anything built-in to handle all the mechanisms for authentication (to handle the forms, sessions, cookies) ?
  • User input - Asp.net, for better or worse, has quite extensive model of handling user submitted data via post backs, raising events on various user activities and simulating events on controls that normally don't have them (image buttons for example). Does PHP have something like this or I am left to manually handle any input submitted by users, going through an array of posted variables and deciding how to respond to each myself?
Thanks in advance,
- barduck

Re: Coming from Asp.net, looking for PHP equivalents for...

Posted: Sun Nov 19, 2006 8:11 am
by feyd
barduck wrote:Master Pages - In Asp.net (2.0), you can tell each page to use a "master page" and then you just write the page content, keeping all your site's overall layout, design and other global appearances/behaviors in one place. The framework knows to take each of these pages and plant them into a defined place in the master page. Is there any similar concept in PHP (or 3rd party libraries)?
Template engines such as Smarty and Template Lite perform this sort of task.
barduck wrote:Web Controls - What's the PHP equivalent for controls that you can just add to a page, set some properties/variables and have them do their thing and render themselves to something useful and reusable (e.g. lists, grids, checkbox lists etc)?
There are libraries, but nothing native.
barduck wrote:Dataset - Holding chunks of data in memory in a database/table like structure. Data not necessary originating from database but also read-only data from XML or text files that can be later queried, sorted, filtered, assigned to web controls and so on. Is there such a thing?
That would depend on the library you use. PHP has some external native support for manipulating XML files, and native support for plain file manipulation. While it doesn't it doesn't support direct sorting and filtering of that data, it can certainly be added by libraries and or your own code.
barduck wrote:Authentication - Is there anything built-in to handle all the mechanisms for authentication (to handle the forms, sessions, cookies) ?
yes, nothing automatic, but yes.
barduck wrote:User input - Asp.net, for better or worse, has quite extensive model of handling user submitted data via post backs, raising events on various user activities and simulating events on controls that normally don't have them (image buttons for example). Does PHP have something like this or I am left to manually handle any input submitted by users, going through an array of posted variables and deciding how to respond to each myself?
For the most part, you will have to decide what your application does. I don't think we'd have it any other way.

Posted: Sun Nov 19, 2006 10:47 am
by neophyte
Remember .NET is a framework. There are tons of different frameworks to choose from in PHP. If you're looking for a framework similar to .NET I'll suggest Prado.