In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
Editor to share with you a sample analysis of the introduction to PHPWeb development, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Learning Notes for getting started with PHPWeb Development
four
I. Notes for PHP web application development
1. Key points of getting started
There are three stages for programmers: programmers (express skills)-> engineers (long-term knowledge)-> experts (research papers)
Three elements of programming: declaration of variables (system, global, field, etc.), data algorithm (application, comparison, calculation, etc.), control structure (change, judgment, loop, etc.)
Three elements of class: encapsulation, inheritance and polymorphism
PHP web application development is divided into two ends: front-end Html+Css+JavaScript static page or UI framework art graphic design, background PHP+MySQL dynamic web page design or interactive data processing
Key points of php knowledge: function, array, object-oriented
Php runtime development environment: lwamp integrated runtime environment Linux/Windows+Apache+MySQL+PHP; strictly distinguishes PHP source code error checking debugging and application project testing IDE integrated development environment ZendStudio/PhpStorm for ordinary code editors
Php introduction learning route: custom build PHP running development environment foundation stone-- > knock code to find feeling-- > GUI graphical interface WYSIWYG design and development project master OOP object-oriented programming ideas-- > training, learning and actual development are synchronously promoted on two platforms-- > the combination of imitation and originality-- > MVC framework infrastructure engineering specification development and front-end UI framework decoration engineering personalized development.
two。 Programming teaches you how to think: 20 years of self-taught programming experience has taught yourself that self-taught programming is a painstaking and inspirational process, but programming is an art, not a pure technology. Ideas are more important than code. Machines are used to work, and people should think. Strong interest + correct method = getting started, e-course + e-textbook + pc test + pc project development = getting started + proficiency. What is programming? Programming is writing a paragraph or writing a composition in English. If you want to get started quickly, you can't be too poor in English. Set TA small goals: fast reading, fast experiment, fast reading, a reasonable understanding, 10 days to cultivate feelings, 30 days to cultivate interest, 100 days to train programming thinking and programming ideas, and 200 days to produce a decent Web Apps project.
3. Road to simple, refined extreme: Web development is based on the idea of object-oriented Oop, with the concept of road to simplicity, using lightweight tools (IDE) to develop high-end practical goods (App), cool atmosphere and smooth simplicity, but simplicity is not simple. "friendly interface, elegant code, system stability" is the eternal pursuit of MIS programmers. MIS's functionality, practicality and stability restrict each other. It all depends on in-depth practice and adapting to business needs to keep up with the trend of the times.
There are three elements of rapid development of 4.Web application: watching tutorials (video), reading programs (documentation), checking code (testing), and repeatedly, in order to complete the demo drill of the development project as learning the overall progress of the development plan, and with questions in the development process to learn the platform to demonstrate repeatedly to complete the learning task. Continuously improve the project planning map to subdivide the learning and development modules and key points of each stage according to the first and second level network plan of project development to continuously promote the learning progress.
5.Web application development process: script editing and debugging, static web site imitation related skills, UI friendly design, view art modularization, dynamic web page native code writing or template framework to achieve MVC or the whole site download content materials quickly generate source code, non-large-scale framework functional structured programming, frame project engineering development. In terms of specific operation, the front-end static processing can use Firefox to sort and collect static page data for secondary development, or you can use DW+Ps to complete art design or WebStorm or HBuilder → html5, css3, js native code to develop original WebApp static pages, and the back-end dynamic development design uses non-graphical interface Oop development environment IDE tool ZendStudio or PhpStorm → to write WebApp development project source code. Rapid framework building recommends visual graphical interface development tool Dreamweaver CS6 WYSIWYG design and development, which can be completed by self-built framework structured programming, or with the help of TinkPHP framework or Smarty template development project. In particular, DW, the Chinese name "Dream Weaver", is a WYSIWYG web editor developed by MACROMEDIA Company in the United States, which integrates web page making and website management. DW is the first set of visual art web page development tools for professional web designers. Static or dynamic web pages can be easily created by using the "drag-and-drop" function. It can be used as an auxiliary tool for Web front-end development or as a good helper for beginners to learn object-oriented programming through GUI graphical interface.
6.PHP learning development: start the development project with the object-oriented Oop idea as far as possible, first modularize the wrapper class, then strive to improve the development efficiency with the general and quick invocation class method, and start the WebApp development with the development and design concept of simplicity. Learning and development are divided into static and dynamic design and programming courses according to web design content, static web learning content basic courses can refer to HTML+CSS+JS actual combat, dynamic web learning content basic courses refer to PHP classic example development, project development practical reference PHP object-oriented project, when large companies develop the same project at the same time, in order to make the front-end art development code concise and clear, quickly focus on static page design. Template specification development mechanism can be used to professionally plan project development projects. App template development refers to Smarty comprehensive mastery of video tutorials, App framework development theory knowledge learning and TinkPHP special topics.
7. Choose the right development tool: if you want to do a good job, you must sharpen it first. Super notepad Notepad++ v7.3.2 (2.8MB) is preferred for lightweight non-graphical interface Opp integrated development tools with only a few megabytes, HBuilder v7.6.5 (3.67MB) is preferred for localized domestic development tools, and ZendStudio v13.5 (320MB) or PHPstorm v2016.3.2 (203MB) is preferred for international standards. Auxiliary development tools preferred Smarty v3.1.30 (0.79MB) official recommendation template, domestic ThinkPHP v3.2.3 (1.08MB) framework; blog, content management system CMS preferred WordPress v4.7.2 (8.9MB); graphical interface database management system preferred official recommendation PhpMyadminv4.6.6 (11MB); beginners introduction to GUI art development tools DW+PHP combination design dynamic website, development browser preferred Firefox Firefox. Learning approach e-classroom: there are 51CTO/ classes in the north and Tencent classes / job coordinates in the south, 51CTO learning and massive resources download are preferred.
8. Zero-foundation quick start skills: give full play to the advantages of personalized local PHP learning development environment resources, while creating two learning and development platforms, learning platform (ZendStudio workspace) d:\ PhpStudy\ www and development platform (my development space rk.com human studio) d:\ PhpRE\ www\ rk, course learning and App project development are combined Provide the experimental results of the learning platform to the project development, use and test in time, use App project development to demonstrate and test the learning effect, adjust learning methods and ideas in time, improve learning efficiency, cultivate interest in programming, use the achievement of daily course code testing to boost energy, promote happy programming, and use success to promote greater success.
9. Compatibility of code migration: PHP7.0.0, which was officially released on December 3, 2015, has downward compatibility as high as 99.9%. However, most of the applications that can run stably and the methods explained in open classes are old versions of code. In the process of Web learning and development, non-native code that wants to be directly migrated or copied and pasted in the PHP7 running environment after download must first pass the latest version of ZendStudio13.5 or PhpStorm2016.3 detection. After the test is successful, it can be used to develop new applications. Compatibility issues focus on database-related PDO applications.
10. Easy to learn happy programming: code is like poetry, programming is like writing poetry. The "hump nomenclature" and "hump command" of the class are like the rhyme of poetry, and the automatic generation of source code by Dreamweaver is like "magician" playing magic. The fun of programming should have the elegance and inspiration of poetry, and enjoy the joy of creation. Getting started quickly does not mean you are in a hurry for success. Programmers surf in the programming sea, experience the fun of programming, combine work and rest, enjoy mountains and rivers, and have a relaxed and happy mood every day in order to create a valuable WebApp boutique.
11. Train of thought determines the way out: when you encounter new problems, do not entangle and waste time, stop to sort out your ideas, or check the data, recharge, use the external brain, another way will be easily solved, and get unexpected results. Before each development, write down one or two short ideas with a small note, and begin to experiment quickly one by one. If it doesn't work, you will come out with a new idea and a new method until the problem is solved. Every cloud has a silver lining. This method is called "note thinking" development, and small notes can solve big problems.
twelve。 Pain and happiness: PHP is a language that is easy to learn but difficult to master, but isn't it true of every programming language? Programmers have to stay up all night and endure loneliness and loneliness alone. Learning and development are three points of heat and seven points of confusion, and every programmer has the same confusion. To be determined to become a qualified PHPer, learning and development must be prepared to suffer pain and loneliness. As the saying goes, "one's life depends on saving oneself, without perseverance and ambition, without success". When entering, you should have confidence in development and cultivate the fun of programming, stick to yourself, be in pain and be happy.
Summary of PHP web application development and learning
1. The array Array () is the bathroom cabinet number $key and the clothes in the cabinet $value to declare a set of data and declare that the array is to create a set of cabinets. The output of the array can be print_r () or print function command var_dump (); the array is a non-custom function, which implements PHP functions and methods together with encapsulated custom functions
two。 The form or Js passes the static page information submitted by the front end through $_ POST submission data to the background php for processing, and $_ GET gets the transfer data php output result
3. Object-oriented learning of non-graphical UI interface starts with encapsulating classes, understands Oop from the attributes and applications of classes, and applies objects to WebApp development. OOPL (Object- Oriented Programming Language) can improve the encapsulation, reusability and maintainability of the program, but it is only "can". Whether these advantages can be really realized or not depends on the degree of application of programmers and designers. As far as PHP is concerned, it is not a purely object-oriented language, but you can still use PHP to write good object-oriented code. Class is the abstract organization of objects, and objects are the concrete existence of classes. The class is instantiated, resulting in a process of instantiation of objects and individuals, that is, from an abstract class to a concrete object. The design of a class needs to fully demonstrate its most important properties and methods, and be able to distinguish it from other things. Instantiation from abstract to concrete makes sense only if the class itself is meaningful. The class defines a series of properties (private) and methods (public), and provides the actual operation details. The method can be used to process the attributes, pass variable values to subsequent programs, and allow subclasses to inherit parent class attributes. The object contains the specific value of the class property, which is the instantiation of the class. It is because of the different attributes that different objects can be distinguished. It is recommended to deepen the understanding and understanding of Oop by using Dreamweaver graphical interface operation.
(1) definition of class
Class class name {}
Class names are named in the same way as variables, with the first letter of the first word capitalized
(2) modifier of class
The default public can be accessed from anywhere in the public domain
Protected protected intra-class subclasses can access the
Private can be accessed within a private class
(3) attributes within the class
The variables defined in the class should be modified with modifiers, otherwise an error will be reported.
(4) in-class method
Functions defined within the class
(5) Construction method
The abstract work used to initialize the class, to make the class general, is generally used to assign values to member attributes, and will be called automatically when the class creates an object. Note that the two underlined elements of "_" are not written wrong. Class instantiation is like "magic" will have a shocking effect to witness miracles.
Public function _ _ construct ([parameter list]) {}
(6) destructing method
Used to do some final processing for the class, calling some methods automatically when the object of the class is no longer in use
Public function _ _ destruct () {}
(7) instantiation of class
Object name = new class name ([parameter list])
Parameters are used to pass parameters to the constructor
(8) access to member properties and methods within the class
Within the class:
$this- > property name [method name]
$this represents the current object
(9) out-of-class references
$object name-> property name [method name]
(10) the static keyword is used to modify member properties or static methods in a class. The properties or method properties modified by this keyword belong to the whole class and do not belong to any object.
(11) in-class access
Self:: property name [method name]
(12) out-of-class access
Class name:: property name [method name]
4.web management information system development core mechanism: the development of MIS with the help of MVC architecture is similar to the three relationships in the database, and then the complex business is shown in the specific front end and program, there are nothing more than four actions, four actions for database operation: Add, Delete, Update, Select. Furthermore, there are actually only two of the four actions: reading and writing. Check for reading, add, delete, change to write, the operation frequency ratio of read-write action is about 10: 1.
Interfaces, pages, styles, scripts, programs, permissions, databases, overall architecture, local architecture, what exactly do you want to look like? Give full play to the characteristics of high-level language encapsulation, inheritance and polymorphism to make the architecture and programs more secure, easy to use, stable, high scalability, high cohesion, low coupling and more powerful. In the process of development, you should record the temporary problems and project inspiration that you encounter, and then in the later modification and expansion or the development of the next project, absorb excellent handling experience and try your best to avoid the problems that have already occurred. Only through such repeated accumulation, their own handling of development details will become more and more perfect.
PHP Web development meets the needs of mobile office equipment. In the dazzling array of Apps applications, compared with the desktop application field of Cmax S architecture, the Web application field of Banner S architecture is more fashionable and more practical, and has become the mainstream of development.
5. Classic PhpStorm IDE development PHPWeb MIS process (front-end UI framework native development mode):
Basic idea: optimize and expand the application of PHP function, install the composer phar dependency package globally under the PHP directory, and directly install and update third-party applications such as whoops fault-tolerant processing technology, Medoo database framework, PHPExcel class library, Twig template engine and so on under the project directory through composer install/update. Through the trigger init.php to pass custom constants and variables to solve a series of development problems such as page linkage response in the UI framework of the MIS front end.
Methods and steps:
Global installation of php dependency package composer- > create project architecture using comporser-> PhpStorm local development
Load the common function ① +...
Load composer ② + ③ + ④ + ⑤
Programming and debugging trigger init.php Integration ① + ②
M layer references ③ + ④
V layer references H-ui or Layui front-end framework static pages and class libraries
C layer reference ⑤
① p ($var) debugging method
② whoops capture error message handling method
③ references the Medoo database framework
Require 'vendor/autoload.php'
/ / initialize the configuration
$database = new medoo (['database_type' = >' mysql', 'database_name' = >' name', 'server' = >' localhost', 'username' = >' your_username', 'password' = >' your_password', 'charset' = >' utf8'])
④ extends the function of PHPExcel class library
Install or update PHPExcel with composer, and flexibly use PHP~MySQL~Excel to complete MIS data conversion, import, export, query, chart, print and other business requirements tasks
⑤ references Twig template
Require_once 'vendor/autoload.php'; $loader = new Twig_Loader_Filesystem (' / path/to/templates'); $twig = new Twig_Environment ($loader, array ('cache' = >' / path/to/compilation_cache',)); echo $twig- > render ('index.html', array (' name' = > 'Fabien'))
Functional structured programming while trying, based on H-ui or Layui front-end framework development, H5 high-end UI and classical modular programming
When the project is launched and put into use, ③ + ④ can be directly referenced in the project core subdirectory independent of composer.
Core content of ⑥ project development
First choose to deploy the front-end UI framework, and then create the corresponding database as needed, and the last thing to do is to easily complete the whole MIS development work with the "five-step method".
Step 1: information collection and storage (emp.xls and other templates)
Step 2: daily business ordinary electronic watch export with header title (default xl5 is easy to convert to dbf) to achieve paperless operation
Step 3: export graphical reports directly with PHPExcel to provide query use or paperless report delivery
Step 4: choose the front-end UI framework menu items and inner pages according to the practical business requirements of MIS, and beautify or optimize the framework operation interface. In the background, Medoo completes the database management of the M layer, adds, deletes, modifies and queries the business information and the UI operation of the V layer, and realizes the relationship between the business logic and the view, especially to make full use of the pop-up box or pop-up layer to guide the business operation process or prompt the running status of the program. Ensure that the user interface is friendly, practical and easy to use
Step 5: optimize the system through third-party vendor class libraries and plug-ins to improve system performance and stability
After the development of ⑦ is completed, after passing the online test, update and upgrade Apps to the App Store with composer.
* publish your own Package
Step 1: log in to github and create a project
Step 2: terminal git clone project address
Step 3: enter the project directory and create a composer.json file: execute the command composer init
Step 4: follow the prompts to complete the configuration file composer.json
* package name /
* description
* author
* minimum stability
* package type
* license
Step 5 command: git add.
Step 6 command: git commit-m "description of changes"
Step 7 command: git push
Step 8: publish to packaglist.org and log in to your own id
Step 9: click submit in the upper right corner, then paste the github connection, and then click check
Step 10: add an automatic update webhook
To the github project, click settings
Click the left navigation webhooks & services
Click the add services on the right
Search package
Fill in user token,token, you can find it by packagist and profile.
Paste token, and then addservice
Then click the generated package to appear.
Click test service, and ok indicates success.
Note: after binding is completed, you will synchronize to package after git submits the update
Background template Agile Framework experience
Experience address: http://learun.cn:8090/
User name: System password: 0000
The above is all the content of the article "sample Analysis of getting started with PHPWeb Development". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.