Building an Event Planning Web Application Using Yii2 Framework

Building an Event Planning Web Application Using Yii2 Framework

CORE Metadata, citation and similar papers at core.ac.uk Provided by Theseus Phuong Nguyen BUILDING AN EVENT PLANNING WEB APPLICATION USING YII2 FRAMEWORK BUILDING AN EVENT PLANNING WEB APPLICATION USING YII2 FRAMEWORK Phuong Nguyen Thesis Autumn 2018 Business Information Technology Oulu University of Applied Sciences ABSTRACT Oulu University of Applied Sciences Business Information Technology Author(s): Phuong Nguyen Title of Bachelor´s thesis: Building an event planning web application using Yii2 framework Supervisor(s): Pekka Ojala Term and year of completion: Autumn 2018 Number of pages: 34 The purpose of this thesis was to build an event planning web application using Yii2 framework to demonstrate the author’s learning process and the compatibility of the framework in web development. The application is where users can personally create and manage contents of events and tasks according to their needs. The application was built based on a PHP framework which provided a useful code generation system with high functional views, models, controller making the development effective and scalable. The thesis will provide a picture how Yii2 framework featuring PHP can make web application development less work effort by using Yii2’s featuring tools in a consistent manner. Generally, it has proved that the framework is a good choice for a quick web application development and makes sure it performs well. The project source code discussion is taken apart in this project thesis and delivered via Github at the following address https://github.com/nguyenhuyphuong2603/eventplanner_thesis Keywords: Yii2, PHP framework, web application development 3 TABLE OF CONTENTS VOCABULARY ......................................................................................................................... 5 1 INTRODUCTION ............................................................................................................. 6 2 THE YII2 FRAMEWORK ............................................................................................... 7 2.1 Introduction to Yii2 Framework ........................................................................ 7 2.1.1 OOP PHP ................................................................................................. 7 2.1.2 Yii2 Framework ....................................................................................... 7 2.2 Code Generation With Gii .................................................................................. 9 2.3 Active Record ...................................................................................................... 11 2.4 Widgets ................................................................................................................. 12 3 DESIGN AND IMPLEMENTATION .......................................................................... 14 3.1 Development Environment .............................................................................. 14 3.1.1 Installing Yii ............................................................................................ 14 3.1.2 Working with databases ..................................................................... 16 3.2 Design .................................................................................................................... 19 3.3 Implementation ................................................................................................... 22 3.3.1 Register ................................................................................................... 22 3.3.2 Authentication ....................................................................................... 23 3.3.3 Features .................................................................................................. 24 3.3.4 Third-party software ............................................................................ 27 4 FINAL PRODUCT ......................................................................................................... 29 5 CONCLUSION ............................................................................................................... 31 6 DISCUSISION ................................................................................................................ 32 REFERENCES ....................................................................................................................... 33 4 VOCABULARY Yii2 An open source, PHP framework MVC Model View Controller PHP Scripting language, PHP: Hypertext Preprocessor OOP Object-oriented programming MySQL Open source relational database management system NPM Node Package Manager CRUD Create Read Update Delete 5 1 INTRODUCTION The purpose of this thesis is to demonstrate the author’s learning process and capability of applying a web development framework (specifically, Yii2 framework) to build a web application. The thesis is author’s initial idea to build a web application in which users can create events and manage them as they want. The product is developed based on PHP for the core technology, MySQL for the database with the assistance from MySQL Workbench for a better visual database architect, and HTML, JavaScript, CSS as both backend and frontend tool. Throughout the thesis work, the essential features of the framework have been introduced such as Gii – the code generator which makes the developers less stressed about the code writing, widgets which give a different way to approach to the views. In term of methodology, a large amount of information has been gained mostly via the framework’s official documentation and guide. Educationally speaking, the work has given and widened the author’s opportunities to have a clear and practical vision to apply theoretical educational background into a real-life application. The thesis explains the process of application design and its implementation utilizing the framework’s outstanding features to illustrate its advanced abilities and effectiveness. Specifically, taking advantages of Yii brings a great deal of outcomes to build a CRUD operational application which has been proved throughout the development process. The thesis work’s result is a properly functional web application that has been reached in terms of capability of running on a localhost and after a server. The application’s expectation has been met for a web application where end users can perform actions they require to use as an online planning event tool. 6 2 THE YII2 FRAMEWORK 2.1 Introduction to Yii2 Framework 2.1.1 OOP PHP Object-oriented programming (OOP) is a programming language added to PHP 5 which makes OOP an approach to software development using objects, which include attributes, and methods in building web application reusable and easier. Object-oriented programming wraps all the concepts e.g. class, object, polymorphism, encapsulation, abstraction, inheritance. PHP is an object-oriented scripting language and supports all the OOP major principles, it is a strong OOP language which was chosen for this project development. Moreover, a PHP framework was considered to inherit and benefit from all the outstanding PHP features to build a reliable, fast web application. 2.1.2 Yii2 Framework According to Portwood II (2016, preface), Yii2 framework is an open source, full- stack and high-performance component-based PHP framework primarily designed for building modern, scalable web applications using PHP as well as RESTful API web services, and so on. Furthermore, it has several code generation facilities and create-read-update-delete (CRUD) interface maker. The framework is fully supported in documentation, guide, and APIs as well as a large actively contributed community. Yii2 framework implements the model-view-controller (MVC) architectural design pattern like most of other popular PHP frameworks. The framework seizes latest technologies for web development such as composer, namespaces. As a result of fact, namespaces introduction in Yii2 gives opportunities that developers 7 encounter solving big problems of name collisions between written code and internal PHP classes/functions or third-party libraries. In additional, using composer is preferred because it enables developers to install, update, and manage all dependencies and extensions for applications by running a single command. It also keeps applications kept up to date with the latest security and bug fixes. (The Definitive Guide to Yii 2.0b, cited 15.02.2018.) Currently, Yii2 framework introduces two available templates to download, advanced template and basic template which was implemented in this thesis application development. Besides implementing MVC, Yii2 framework introduces a front-controller, called Application, encapsulating the execution context for the processing of a request. FIGURE 1. A typical static structure of an application (The Definitive Guide to Yii 2.0a, cited 15.02.2018.) 8 Moreover, there are different following entities in Yii applications listed below • Entry scripts: Accessible PHP scripts responsible for starting a request handling cycle • Applications: Globally accessible objects that manage application components and coordinate them to execute requests • Application components: registered objects with applications and provide services to fulfil requests • Modules: self-contained packages contain complete MVC by themselves • Filters: code that need to be invoked before and after the actual handling of requests by controllers • Widgets: objects embedded in views (The Definitive Guide to Yii 2.0a, cited 15.02.2018.)

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    34 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us