了解PHP中的CodeIgniter框架的基本要素

Understanding the nuts and bolts of CodeIgniter framework in PHP

了解PHP中的CodeIgniter框架的基本要素

If you’re an avid PHP lover then I’m sure you must have definitely heard about the Codelgniter framework. Well, if you haven’t then no need to worry because this is the blog that will tell you everything about the very popular and trendy ColdeIgniter framework used in PHP programming. Whether you’re planning to build a fine-quality PHP application or a brand new website, Codelgniter will allow you to save a considerable amount of time and effort on serving your clients with the expected final product.

如果您是一个*PHP爱好者,那么我相信您肯定已经听说过Codelgniter框架。 好吧,如果您没有那么担心,因为这是一个博客,它将告诉您有关PHP编程中非常流行和流行的ColdeIgniter框架的所有信息。 无论您打算构建优质PHP应用程序还是全新的网站,Codelgniter都可以帮助您节省大量的时间和精力,以期为您提供预期的最终产品。

There’s a lot more to unveil about this absolutely enchanting PHP web development framework. So, let’s go ahead and explore more about it.

关于这个绝对迷人PHP Web开发框架,还有很多要揭示的内容。 因此,让我们继续探索它。

什么是“框架”? (What exactly is a ‘Framework’?)

Well, before proceeding ahead with the ins and outs about CodeIgniter PHP framework, let me make you familiar with what exactly is a framework. The term ‘framework’ refers to a collection of support programs, tool sets, code libraries and APIs (Application Programming Interfaces) that aid a developer in executing a web development project with ease. The pre-built functions of a framework enable easier and faster project completions.

好吧,在继续进行有关CodeIgniter PHP框架的来龙去脉之前,让我让您熟悉什么是框架。 术语“框架”是指支持程序,工具集,代码库和API(应用程序编程接口)的集合,可帮助开发人员轻松执行Web开发项目。 框架的预先构建的功能使项目更容易,更快捷地完成。

简要介绍Codelgniter作为PHP Web开发框架的作用? (A brief on Codelgniter’s role as a PHP web development framework?)

了解PHP中的CodeIgniter框架的基本要素

As one of the most loved PHP frameworks among developers, Codelgniter allows you to build better apps and sites via clean and crisp coding. Being a free and simple to install framework, Codelgniter can be easily used by amateurs in the field of PHP web development. Equipped with a rich set of libraries, simple interface and a logical structure, Codelgniter serves as the best toolkit for individuals who want to build high-performing applications using PHP. With Codelgniter, you can minimize the amount of coding that’s required for completion of a particular task within the app/website development project. Codelgniter’s version 1.5 consumes only 737 KB of system space, preventing you from the hassles of waiting for a long time to download the entire software program. You can simply visit the official website at codeigniter.com and download the software in a convenient way.

作为开发人员中最喜欢PHP框架之一,Codelgniter允许您通过简洁明了的编码来构建更好的应用程序和网站。 作为一个免费且易于安装的框架,Codelgniter可以被PHP Web开发领域的业余爱好者轻松使用。 配备了丰富的库,简单的界面和逻辑结构,Codelgniter是想要使用PHP构建高性能应用程序的个人的最佳工具包。 使用Codelgniter,您可以最大程度地减少完成应用程序/网站开发项目中的特定任务所需的编码量。 Codelgniter的1.5版仅占用737 KB的系统空间,从而避免了等待很长时间才能下载整个软件程序的麻烦。 您可以简单地访问官方网站codeigniter.com并以方便的方式下载该软件。

CodeIgniter –安装过程简介 (CodeIgniter – A brief on installation process)

You can choose to install CodeIgniter using the following 4 steps:

您可以选择使用以下4个步骤安装CodeIgniter:

了解PHP中的CodeIgniter框架的基本要素

Step 1 – Unzip the downloaded CodeIgniter package.

步骤1 –解压缩下载的CodeIgniter软件包。

Step 2 – Upload the CodeIgniter files and folders to your web server, keeping index.php as the root file.

步骤2 –将CodeIgniter文件和文件夹上载到Web服务器,并保留index.php作为根文件。

Step 3 – Now, open the application/config/config.php file containing the text editor and set the base URL.

步骤3 –现在,打开包含文本编辑器的application / config / config.php文件,并设置基本URL。

Step 4 – If you’re inclined on using a database, then open the application/config/database.php file containing the text editor and set the preferred database settings.

步骤4 –如果您倾向于使用数据库,请打开包含文本编辑器的application / config / database.php文件并设置首选数据库设置。

As an approach to increase the system security, you may opt for hiding the location of your CodeIgniter files by renaming the system folder to something that’s more difficult to *****. On renaming the system folder, do open the main index.php file and set the $system_folder variable located towards the top of the page with the new name that you’ve chosen for the respective folder.

作为提高系统安全性的一种方法,您可以通过将系统文件夹重命名为更难以**的名称来选择隐藏CodeIgniter文件的位置。 重命名系统文件夹时,请打开主index.php文件,并使用为各个文件夹选择的新名称设置位于页面顶部的$ system_folder变量。

CodeIgniter –如何运作? (CodeIgniter – How does it work?)

Serving itself as one of the best PHP frameworks, CodeIgniter does the following:

作为最佳PHP框架之一,CodeIgniter可以执行以下操作:

  • It generates clean URLs – All the URLs generated by CodeIgniter are clean, crisp and search engine friendly. Using a segment-based coding approach, CodeIgniter ensures that its users aren’t held prey to buggy codes and ill-treated methods and functions.它生成干净的URL – CodeIgniter生成的所有URL都是干净,明快且对搜索引擎友好的。 使用基于段的编码方法,CodeIgniter可以确保其用户不会被错误的代码以及不良的方法和功能所困扰。
  • It ensures component singularity – Component singularity is one of the major functions performed by CodeIgniter. The term ‘singularity’ refers to the degree to which different project components has a specific focused purpose. All the classes and related functions used in CodeIgniter are kept autonomous, as an attempt to optimize usefulness.它确保了组件的奇异性 –组件的奇异性是CodeIgniter执行的主要功能之一。 术语“奇异性”是指不同项目组成部分具有特定针对性目的的程度。 CodeIgniter中使用的所有类和相关功能都保持自主,以尝试优化实用性。
  • It ensures dynamic manifestation – While working with the CodeIgniter framework, you’ll find that all the components are loaded and all the routines are executed only when they’re requested to do so. With no assumptions being pre-made by the system, you can enjoy faster web development by default. The events triggered by the HTTP request coupled with the views and controller will actually determine the method/function that needs to be invoked.它确保动态表现 –在使用CodeIgniter框架时,您会发现所有组件均已加载,并且所有例程仅在被要求执行时才执行。 系统无需进行任何假设,默认情况下您可以享受更快的Web开发速度。 HTTP请求以及视图和控制器所触发的事件实际上将确定需要调用的方法/函数。

CodeIgniter-最适合谁? (CodeIgniter- Whom does it suite the best?)

CodeIgniter can serve as your perfect partner during PHP web development if:

如果满足以下条件,CodeIgniter可以在PHP Web开发过程中成为您的理想合作伙伴:

  • You’re in need of a framework that’s equipped with a small footprint

    您需要一个占地面积小的框架
  • You need a PHP framework that comes with zero configuration

    您需要零配置附带PHP框架
  • You require a wide compatibility with hosting account that operate a variety of PHP versions and configurations.

    您需要与运行各种PHP版本和配置的托管帐户具有广泛的兼容性。
  • You don’t want to get stressed by learning a brand new templating language

    您不想通过学习全新的模板语言而感到压力
  • You need a clear and well-defined documentation

    您需要清晰且定义明确的文档

结语 (Wrapping Up)

As a remarkable enterprise class PHP web application development framework, CodeIgniter works for business professionals who need to upgrade their offerings on a regular basis and want to inform their customers regarding the same. A PHP-based MVC framework, CodeIgniter comes with a low learning curve, making it comfortable for the novice PHP developers to embrace it with full zest.

作为出色的企业级PHP Web应用程序开发框架,CodeIgniter适用于需要定期升级产品并希望将其告知客户的业务专业人士。 CodeIgniter是基于PHP的MVC框架,具有较低的学习曲线,使PHP新手可以轻松地完全拥抱它。

翻译自: https://www.script-tutorials.com/understanding-codeigniter-framework-in-php/