学习PHP不久,直接学习laravel应不应该……看文档不是特别理解…是应该边学laravel变学php还是,php有点基础再来学
回复内容:
不建议直接使用框架,尤其是新手建议先弄明白一些东西的具体实现原理,等积累好了再用框架的话会少很多疑问,可以参考我之前的回答(想要开发自己的PHP框架需要那些知识储备? - 安正超的回答)积累好基础知识。很多人总把 “基础知识” 认为很少,很简单,然而你会发现它却是最重要的部分,所有的复杂实现都是在基础之上的搭配,把基础掌握好了,就算遇到框架问题还可以不吃力的看源码。
谢谢! 你至少先会做个留言板,然后学会PHP中的面相对象,然后再去学框架 先用还是先不用其实没有必然答案,如果按照练级的最佳策略的话,当然是先裸写一段时间,被各种问题虐一遍,然后再使用框架,享受框架的便利,从以往的问题去理解框架的设计。
但是实际情况天知道,也许现实就是逼迫你最近就要用PHP写点啥,没那个时间去完美练级,那干嘛不用框架。
开始就裸写结果根本不知道如何开始,挫败感容易导致放弃。使用框架至少一开始就能干点啥,有足够的成就感支撑继续前进。
框架就是一个工具,人就是要善用工具,自己判断合适就用。
重要的是,是你控制工具而不是工具控制你,所以长期来看,掌握框架下面的东西非常必要,否则就被框架所奴役,离了框架啥都不知道。这种人其实很多,我面试了多个工作多年的PHP程序员都如此,但这是框架的错还是人的错? 可以直接学,但是直接学不是去看文档,laravel文档很好,但是它是用来查阅的,很多概念以你现在的基础会看糊涂,你要先看laravel的基础教程。
文档看得累的话,可以看看我写的教程:Laravel 5.1 文档攻略——概述 laravel5 之后强制使用命名空间,你明白命名空间的意思吗?
框架只是工具,用起来是否顺手重点还是要看自己的能力。关公的青龙偃月刀是大杀器,但是你能想象在吕秀才手里会是怎么个情景吗? 虽然不是PHPer,但各语言都是相通的。建议你多花时间学习实践语言的基础,一年半载后,相信各种框架你都能够迅速上手。 PHP的应用简单的一逼,随便找个中专生都能在一个星期内掌握PHP+某个框架,看着文档跟着做一遍随手都能写个网站出来,完全可以按照自己的步调慢慢学,重点在于高并发性能的优化和安全加固,这两样需要正经去学。
但我建议还是不要学PHP了,一来PHP早已日薄西山将会被Python、.NET等后继者取代,二来这是我国大量低学历年轻人的饭碗,给他们口饭吃就是为国家社会稳定做贡献啊。 先学会手写MVC和理解框架,再谈用框架,虽然都可以不做,但是你一辈子高度就这样了,码农和研究者 菜鸟稍微说一句,俺是做毕业设计的时候用到了Laravel。
之前编程基础还算是有些,在校时学过点算法,后来又搞过点android,现在是产品汪。。学之前先把php的基础知识过了一遍,然后就开始学Laravel的。中文文档,各种教程都研究了一段时间之后,直接开始做自己的项目,因为业务逻辑不算很复杂,做起来还比较流畅。当然后来因为要完善系统,还是费了点功夫。
总之,如果不是很急,php基础牢固点在学Laravel肯定更顺手,框架的便捷功能都会在学习语言的过程中实践到‘;如果你是出于兴趣或者自己的学习项目而且有一定编程基础,那直接学Laravel也应该能很快上手(废话:想做好肯定要打基础滴)。
另外楼上 @安正超的lavavel教学视频(好像是Laravel4吧)简单易懂没有废话,学习过程中受益不少,特此感谢下安大大~ 勇敢去学,不是非得学会坏的习惯才能学习好习惯。命名空间、依赖反转、良好的命名和丰富的设计模式,这些会在你学习的过程中潜移默化的影响你,养成良好的编程习惯

TooptimizePHPcodeforreducedmemoryusageandexecutiontime,followthesesteps:1)Usereferencesinsteadofcopyinglargedatastructurestoreducememoryconsumption.2)LeveragePHP'sbuilt-infunctionslikearray_mapforfasterexecution.3)Implementcachingmechanisms,suchasAPC

PHPisusedforsendingemailsduetoitsintegrationwithservermailservicesandexternalSMTPproviders,automatingnotificationsandmarketingcampaigns.1)SetupyourPHPenvironmentwithawebserverandPHP,ensuringthemailfunctionisenabled.2)UseabasicscriptwithPHP'smailfunct

The best way to send emails is to use the PHPMailer library. 1) Using the mail() function is simple but unreliable, which may cause emails to enter spam or cannot be delivered. 2) PHPMailer provides better control and reliability, and supports HTML mail, attachments and SMTP authentication. 3) Make sure SMTP settings are configured correctly and encryption (such as STARTTLS or SSL/TLS) is used to enhance security. 4) For large amounts of emails, consider using a mail queue system to optimize performance.

CustomheadersandadvancedfeaturesinPHPemailenhancefunctionalityandreliability.1)Customheadersaddmetadatafortrackingandcategorization.2)HTMLemailsallowformattingandinteractivity.3)AttachmentscanbesentusinglibrarieslikePHPMailer.4)SMTPauthenticationimpr

Sending mail using PHP and SMTP can be achieved through the PHPMailer library. 1) Install and configure PHPMailer, 2) Set SMTP server details, 3) Define the email content, 4) Send emails and handle errors. Use this method to ensure the reliability and security of emails.

ThebestapproachforsendingemailsinPHPisusingthePHPMailerlibraryduetoitsreliability,featurerichness,andeaseofuse.PHPMailersupportsSMTP,providesdetailederrorhandling,allowssendingHTMLandplaintextemails,supportsattachments,andenhancessecurity.Foroptimalu

The reason for using Dependency Injection (DI) is that it promotes loose coupling, testability, and maintainability of the code. 1) Use constructor to inject dependencies, 2) Avoid using service locators, 3) Use dependency injection containers to manage dependencies, 4) Improve testability through injecting dependencies, 5) Avoid over-injection dependencies, 6) Consider the impact of DI on performance.

PHPperformancetuningiscrucialbecauseitenhancesspeedandefficiency,whicharevitalforwebapplications.1)CachingwithAPCureducesdatabaseloadandimprovesresponsetimes.2)Optimizingdatabasequeriesbyselectingnecessarycolumnsandusingindexingspeedsupdataretrieval.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Zend Studio 13.0.1
Powerful PHP integrated development environment

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software
