没有合适的资源?快使用搜索试试~ 我知道了~
这个是在外国的网站上面找到的一个关于symfony的开发的比较具体的开发文档,这个文档是针对于symfony3.0的说明文档。
资源推荐
资源详情
资源评论
The Cookbook
Version: 3.0
generated on March 4, 2016
The Cookbook (3.0)
This work is licensed under the “Attribution-Share Alike 3.0 Unported” license (http://creativecommons.org/
licenses/by-sa/3.0/).
You are free to share (to copy, distribute and transmit the work), and to remix (to adapt the work) under the
following conditions:
• Attribution: You must attribute the work in the manner specified by the author or licensor (but
not in any way that suggests that they endorse you or your use of the work).
• Share Alike: If you alter, transform, or build upon this work, you may distribute the resulting work
only under the same, similar or a compatible license. For any reuse or distribution, you must make
clear to others the license terms of this work.
The information in this book is distributed on an “as is” basis, without warranty. Although every precaution
has been taken in the preparation of this work, neither the author(s) nor SensioLabs shall have any liability to
any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by
the information contained in this work.
If you find typos or errors, feel free to report them by creating a ticket on the Symfony ticketing system
(http://github.com/symfony/symfony-docs/issues). Based on tickets and users feedback, this book is
continuously updated.
Contents at a Glance
How to Use Assetic for Asset Management ..........................................................................................7
Combining, Compiling and Minimizing Web Assets with PHP Libraries.............................................14
How to Minify CSS/JS Files (Using UglifyJS and UglifyCSS) ...............................................................17
How to Minify JavaScripts and Stylesheets with YUI Compressor.......................................................21
How to Use Assetic for Image Optimization with Twig Functions ......................................................24
How to Apply an Assetic Filter to a specific File Extension .................................................................27
How to Install 3rd Party Bundles .......................................................................................................29
Best Practices for Reusable Bundles ...................................................................................................32
How to Use Bundle Inheritance to Override Parts of a Bundle ............................................................39
How to Override any Part of a Bundle ...............................................................................................41
How to Remove the AcmeDemoBundle.............................................................................................44
How to Load Service Configuration inside a Bundle...........................................................................47
How to Create Friendly Configuration for a Bundle ...........................................................................50
How to Simplify Configuration of multiple Bundles ...........................................................................56
How to Use Varnish to Speed up my Website ....................................................................................59
Caching Pages that Contain CSRF Protected Forms ...........................................................................63
Installing Composer..........................................................................................................................64
How to Master and Create new Environments ...................................................................................66
Building your own Framework with the MicroKernelTrait..................................................................71
How to Override Symfony's default Directory Structure .....................................................................77
Using Parameters within a Dependency Injection Class ......................................................................81
Understanding how the Front Controller, Kernel and Environments Work together............................84
How to Set external Parameters in the Service Container ....................................................................87
How to Use the Apache Router .........................................................................................................90
Configuring a Web Server .................................................................................................................91
How to Organize Configuration Files ................................................................................................97
How to Create a Console Command ............................................................................................... 102
How to Use the Console.................................................................................................................. 106
How to Style a Console Command ..................................................................................................107
How to Call a Command from a Controller .....................................................................................115
How to Generate URLs from the Console ........................................................................................117
How to Enable Logging in Console Commands ...............................................................................119
How to Define Commands as Services ............................................................................................. 123
How to Customize Error Pages........................................................................................................126
How to Define Controllers as Services .............................................................................................131
How to Upload Files .......................................................................................................................137
PDF brought to you by
generated on March 4, 2016
Contents at a Glance | iii
How to Optimize your Development Environment for Debugging.................................................... 141
How to Deploy a Symfony Application ............................................................................................143
Deploying to Microsoft Azure Website Cloud..................................................................................147
Deploying to Heroku Cloud ............................................................................................................160
Deploying to Platform.sh................................................................................................................. 166
How to Handle File Uploads with Doctrine ..................................................................................... 170
How to use Doctrine Extensions: Timestampable, Sluggable, Translatable, etc. ................................179
How to Register Event Listeners and Subscribers ............................................................................. 180
How to Use Doctrine DBAL ............................................................................................................ 183
How to Generate Entities from an Existing Database........................................................................ 185
How to Work with multiple Entity Managers and Connections........................................................189
How to Register custom DQL Functions..........................................................................................192
How to Define Relationships with Abstract Classes and Interfaces....................................................193
How to Provide Model Classes for several Doctrine Implementations ............................................... 196
How to Implement a Simple Registration Form................................................................................199
How to Use PdoSessionHandler to Store Sessions in the Database.................................................... 206
How to Use MongoDbSessionHandler to Store Sessions in a MongoDB Database............................. 209
Console Commands........................................................................................................................211
How to Send an Email.....................................................................................................................212
How to Use Gmail to Send Emails ...................................................................................................215
How to Use the Cloud to Send Emails .............................................................................................217
How to Work with Emails during Development...............................................................................219
How to Spool Emails....................................................................................................................... 222
How to Test that an Email is Sent in a Functional Test.....................................................................224
How to Create Event Listeners and Subscribers................................................................................ 226
How to Set Up Before and After Filters ............................................................................................ 230
How to Extend a Class without Using Inheritance............................................................................ 234
How to Customize a Method Behavior without Using Inheritance.................................................... 237
How to use Expressions in Security, Routing, Services, and Validation .............................................239
How to Customize Form Rendering ................................................................................................242
How to Use Data Transformers .......................................................................................................256
How to Dynamically Modify Forms Using Form Events ...................................................................265
How to Embed a Collection of Forms.............................................................................................. 276
How to Create a Custom Form Field Type.......................................................................................289
How to Create a Form Type Extension ............................................................................................294
How to Reduce Code Duplication with "inherit_data" ..................................................................... 300
How to Unit Test your Forms.......................................................................................................... 303
How to Configure empty Data for a Form Class...............................................................................308
How to Use the submit() Function to Handle Form Submissions......................................................310
How to Use the virtual Form Field Option....................................................................................... 312
Using Bower with Symfony ............................................................................................................. 313
How to Install or Upgrade to the Latest, Unreleased Symfony Version.............................................. 316
How to Use Monolog to Write Logs ................................................................................................318
How to Configure Monolog to Email Errors .................................................................................... 323
How to Configure Monolog to Display Console Messages................................................................ 325
How to Configure Monolog to Exclude 404 Errors from the Log ...................................................... 327
How to Log Messages to different Files............................................................................................328
iv | Contents at a Glance
Contents at a Glance | 4
How to Create a custom Data Collector...........................................................................................330
How to Use Matchers to Enable the Profiler Conditionally............................................................... 335
Switching the Profiler Storage..........................................................................................................337
How to Access Profiling Data Programmatically............................................................................... 338
How to Configure Symfony to Work behind a Load Balancer or a Reverse Proxy .............................. 340
How to Register a new Request Format and Mime Type...................................................................342
How to Force Routes to always Use HTTPS or HTTP ...................................................................... 344
How to Allow a "/" Character in a Route Parameter .........................................................................345
How to Configure a Redirect without a custom Controller ............................................................... 346
How to Use HTTP Methods beyond GET and POST in Routes ........................................................348
How to Use Service Container Parameters in your Routes ................................................................ 350
How to Create a custom Route Loader ............................................................................................352
Redirect URLs with a Trailing Slash.................................................................................................357
How to Pass Extra Information from a Route to a Controller............................................................359
How to Build a Traditional Login Form ...........................................................................................360
How to Load Security Users from the Database (the Entity Provider)................................................ 365
How to Create a Custom Authentication System with Guard ........................................................... 373
How to Add "Remember Me" Login Functionality ...........................................................................381
How to Impersonate a User.............................................................................................................385
How to Customize your Form Login................................................................................................388
How to Create a custom User Provider ............................................................................................ 391
How to Create a Custom Form Password Authenticator................................................................... 396
How to Authenticate Users with API Keys .......................................................................................400
How to Create a custom Authentication Provider............................................................................. 409
Using pre Authenticated Security Firewalls ......................................................................................419
How to Change the default Target Path Behavior .............................................................................421
Using CSRF Protection in the Login Form........................................................................................423
How to Choose the Password Encoder Algorithm Dynamically ........................................................ 425
How to Use multiple User Providers ................................................................................................ 427
How to Restrict Firewalls to a Specific Request ................................................................................429
How to Restrict Firewalls to a Specific Host.....................................................................................431
How to Create and Enable Custom User Checkers...........................................................................432
How to Use Voters to Check User Permissions.................................................................................435
How to Use Access Control Lists (ACLs) .........................................................................................441
How to Use advanced ACL Concepts .............................................................................................. 445
How to Force HTTPS or HTTP for different URLs........................................................................... 449
How to Secure any Service or Method in your Application ...............................................................450
How Does the Security access_control Work?.................................................................................. 454
How to Use the Serializer ................................................................................................................458
How to Define Non Shared Services ................................................................................................ 461
How to Work with Compiler Passes in Bundles ...............................................................................462
Session Proxy Examples ..................................................................................................................463
Making the Locale "Sticky" during a User's Session ..........................................................................465
Configuring the Directory where Session Files are Saved ..................................................................468
Bridge a legacy Application with Symfony Sessions ..........................................................................470
Limit Session Metadata Writes ........................................................................................................471
Avoid Starting Sessions for Anonymous Users.................................................................................. 472
PDF brought to you by
generated on March 4, 2016
Contents at a Glance | v
剩余534页未读,继续阅读
资源评论
月女冬舞
- 粉丝: 8
- 资源: 14
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 使用Dockerfile配置Springboot应用服务发布Docker镜像-源码
- 万维考试系统-C语言题库-含题目-程序设计题导出-113道.doc
- Alibaba SpringCloud集成Nacos、openFeign实现负载均衡-源码
- 用户研究系列之Persona介绍(用户画像)
- Image_1715110604427.jpg
- mYzh..trashed-1716951334-.jpg
- Alibaba SpringCloud集成nacos实现配置中心
- 那些好的不像话的心流体验
- 基于pytorch的卷积神经网络识别是否为奥特曼的项目python源码+文档说明+数据集(课程设计)
- 基于卷积神经网络的图像风格迁移python源码+文档说明+界面图片(课程设计)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功