Yii Framework and MVC Architecture: SCMA Prototype Development Report

Verified

Added on  2019/09/25

|4
|921
|436
Report
AI Summary
This report details the development of the SCMA prototype, a web application built using the Yii framework and following the Model-View-Controller (MVC) architectural pattern. The development process involved creating model classes for users, schools, departments, courses, and course years, leveraging the GII facility of the Yii framework for efficient model and controller generation. The application utilizes a database setup via phpMyAdmin, with the database path configured in the Yii framework's config file. The report describes the implementation of user authentication, distinguishing between superadmin and admin roles, and the use of AJAX to enhance data fetching and display in JSON format. The report highlights the functional requirements, including the ability for admin users to manage website data through CRUD operations and the provision of a student search functionality with multiple search fields. It also discusses encountered problems, specifically the issues faced while integrating Yii-1 and Yii-2 frameworks, and reflects on the successful implementation of the prototype, including the use of AJAX and the role-based access control. References to Yii framework documentation, MVC architecture resources, and related technologies are also provided.
Document Page
REFLECTIVE ESSAY
Development Methodolgy:-
To develop this prototype. We need to develop first model classes. Model
classes for users, school, department, courses, courseyear, and their have been
developed. This work can be easily done using GII facility of yii famework. In
that model classes and controllers can be directly made through user interface.
It is linked with the database tables made in phpMyAdmin. Database is to be
setup by importing the current needed files in of sql in phpMyAdmin. After
that in config file of yii framework we need to set the database path. After this
configuration, our models are ready to be used. Using users tables, login
identifies the user. They have a role number. Superadmin have role number 1
and Admin have role number 2. This is to identify who can create admin or not.
Admin manager page is only visible to role1 i.e superadmin. Then AJAX is
added during fetching the students searched data. Ajax is introduced to gain
the facility of JSON format data. In this way approach to develop admin and
student have been taken.
MVC Framework:-
This framework or better to say pattern separates the application into three
different parts.
1. Models
2. Views
3. Controllers
Models
Model is the structure of table used in database. This is in simple language. But
in logical sense, model relates to the data related to logic of its existence. It
contains the data structure that is to be transferred between View and
Controller.
Views
View contains the User Interface logic for the given application. It fetches data
from controller using help of model structure given and shows it to user. It
includes component such as text, boxes, and other information related things.
Controllers
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
They are they interface between Models and Views for processing all the logic
and requests of data and finally render the final output which is shown in view.
Problems Encountered:-
While trying this structure to be implemented, both frameworks, yii-1 nd yii-2
were used at one time, which made whole app crashed. After some time whole
project was rebuild in yii-2 framework. Also trying to make separate student
login was also a great confusion on its own. Some logical concepts were drawn
and then solution let the prototype to be developed. Using Ajax in between
was a great fun.
Functional Requirement
1. Admin user can login using their emails or username. If we want to allow
using email, simply put email also in username. This functionality is
made possible as we require three thing username, email and password.
Although email was asked , but if someone wants to add different
username then email, for the extra support it is added, now if someone
want some other name, he can put it in username else put email id in
username and you will be able to login through email id and password.
2. Admin user can only edit data of website, but cannot make other admin
users. Users can only be made by Superadmin. This functionality was
made possible by logic that, superadmin has role variable 1 and admin
have role variable as 2. If role variable 1 then only user can create admin
else user cannot. Being role 1 itself suggests that user is superadmin.
3. All the admins and superadmin can do CRUD functionality on data. All
the create, read, update and delete operations are provided for admins
which was the functional need of the project. This is done by a simple
logic of role based users. Superadmin has role1 and admin have role2.
Logic is simple that role is less than three than user can do CRUD
operations on data available. This logic made this functionality possible
to implement.
Non Functional Requirement
1. Student can easily come and see their required data by searching. They
do not need to edit any data. Just check data and go. This is the only non
functional requirement of the project. Because only search is
implemented and no admin operation is done here. This is done as
required homepage contains 5 search fields.
Document Page
a. School
b. Departments
c. Courses
d. Course Year
e. Course Handbook
On selecting these search fields, One can search and get desired results. On
selecting School field, Department options get refreshed with available
department in that school. On selecting departments, courses fields got
refreshed and courses that are available in that department are shown. In this
manner course year and course handbook are selected. On combining all five
fields a search is made which shows all the related data to that particular
search. The data can be any text, any image or some videos or dome book link
uploaded by any admin user. In this way this project comes to end. Required
pages are dashboard page for admin/superadmin to add/delete data to
prototype. And homepage for student to search for the required data. This is
complete prototype of the SCMA.
Document Page
REFRENCES
1. https://www.yiiframework.com/doc/api/2.0
2. https://developer.mozilla.org/en-US/docs/Web/Apps/Fundamentals/
Modern_web_app_architecture/MVC_architecture
3. https://developer.chrome.com/apps/app_frameworks
4. https://en.wikipedia.org/wiki/Model–view–controller
5. https://docs.spring.io/spring/docs/3.0.x/spring-framework-reference/html/mvc.html
6. https://www.yiiframework.com/doc/guide/1.1/en/basics.mvc
chevron_up_icon
1 out of 4
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]