9

Today I gave Php a try, I leaned the basics and oriented object programming of it . but now I dont know how to make UI in PHP . ans I need some advice what should I learn next im a .net programmer

Comments
  • 1
    @Artemix yeah I know that but in asp they separated the UI and the Script qnd you can access UI view via script so how can I do that with php.
  • 0
    You use javascript to make a ui, take a look @ bootstrap for example
  • 0
    @Artemix which part do you not understand
  • 0
    @RazorSh4rk hi I know how to use bootstrap . what I dont know is for example how to make a table from database or how to make a dropDowList from database.
  • 0
    @baronsindo oh, you just
    echo '<table>' . row['asd'] . '</table>'

    I thought you meant like responsive desing and such
  • 2
    @Artemix yo i hate js but lets be real, nobody builds sites with plain html anymore
  • 0
    Can u guys recommend any tutorial. For a site with responsive UI and php
  • 1
    @Artemix meh, throwing together something in angular is way easier but whatever floats your boat, i usually stay away from web. I aint very good at php, usually use it for curl
  • 2
    @baronsindo isnt there something on w3schools?
  • 1
    @RazorSh4rk just basics , I finished basics in one day and I built a restful api for my android app with php mysql . but I have no idea fo ui .
  • 1
    @baronsindo okay artemix will prolly disagree with ne, but just echo out the sql contents to plain html, then find a good frontend framework and let it handle the rest
  • 1
    @RazorSh4rk thaks could you recommend a front end framework for me . im like u a desktop android developer. I hate web but I have to learn it .
  • 1
    @baronsindo jquery and bootstrap together maybe, but you can get away with just bootstrap. I think i have a repo on my github, the league of legends webapp, what does exactly this, check the code if you want, its kinda simple
  • 0
    @Artemix I know some angularjs . and angular4 . those you gave me now are js frameworks ???
  • 1
    Oh yeah, vue.js is really good
  • 0
    @Artemix so I can create php UI with vue.js ??
  • 0
    @Artemix so php and asp are different ?? Even when they run at server.
  • 2
    Here, explanation

    You have a server with sql. You use php to get the data from sql. Then you use php to just dump out the data to a simple html file. After that you use one of the things we listed (bootstrap, vue, etc) to make that html look good
  • 0
    @Artemix thanks a lot for your help :) . I'll learn what you recommend for me.
  • 0
    @RazorSh4rk thats a helpful explain. Thanks a lot I'll keep learning it.
  • 1
    Happy to help and good luck
  • 1
    @baronsindo as @RazorSh4rk say about dump php into html. This does not mean an. Html page. Still a .php page but the content on it is html so that when you have php data you can escape into php and place on page which then gets rendered as html when requested. Just a thought.
  • 0
    When you try php. What do you do?
    - Installed XAMP and make a site.
    - Run php in CLI
    - php -S
    - Other
  • 0
    Take a look at some templating library for HTML output. It's much clearer and easier to create than just echoing data with HTML. I would reccomend Latte (part of Nette framework, but could be used standalone). It has easy to learn and understandable syntax even for people without PHP knowledge.
  • 0
    @hitzoR thanks I'll take a look on that framework sir .
  • 6
    This thread is confusing, is it trolling?

    @Artemix is giving perfect explanations and the questions keep coming.
  • 3
    This my advice:

    RUN AWAY
  • 0
    @organic-ai hhhhhhh why ?
  • 2
    Golang is amazing. So much support and so many libraries, best of all the worlds. Great for Dev
  • 2
    Just try to make Ajax calls using jQuery to your .php files. Encode what you return from PHP as JSON. Use bootstrap to style the site. Get that working before looking at frameworks.
  • 0
    @jonez788 can you please recommend a tutorial.
  • 1
    @baronsindo yes, they are. PHP is a language, ASP is a framework.
    Don't forget that PHP is a server side language, and it's never sent to thw client. For client side, you need HTML (with ASO is quite the same thing..)

    If you need a framework for PHP, try looking at zend framework or laravel.
  • 3
    You are a .NET dev? Why would you do PHP? Unfortunately there is an enormous amount of crappy php code out there. You'd better stick to .NET and learn something like Java. Switch will be much easier and Java is excellent OO too. As .net dev you learned to create UI as well I assume? If not focus on front end development if you want to be able to build a decent ui, regardless of the back end technology you use.
  • 1
    @baronsindo I spent a while as a php Dev, now I'm switching to c#.

    My advice is don't switch.
  • 1
  • 2
    Ok, look, you're probably coming from ASP.NET Webforms.
    There's no easy way of saying this, but .. forget everything you know about web development.

    ASP.NET Webforms have committed the capital sin by trying to seamlessly link UI elements with the code, which turned into something really really awful that I only get in nightmares.

    Think of it this way:
    There is the UI (client side) and the Back-end (server side). The only way they can communicate is via HTTP requests and web sockets.
    Today, the 2 are built separately, often by separate people. The front-end is usually absolutely independent, served using static files even (pure html, js, css for example) then the JS pulls relevant data from the back-end and displays it on the page.
    But even if you do it the older way, it still means that you have a template that's filled out with data on the back-end, and sends all responses using AJAX or form submits. You have to code all of that.

    If it's not accurate, it's because I'm not a UI dev
Add Comment