Application Skeleton for YiiFramework - php

I am looking for a skeleton application for the YiiFramework to get me up-and-running with a simple PHP application I would like to build. Some requirements are:
A login/authentication system that keeps the current user's session state (and is secure from injection attacks, etc).
It connects to a back-end database (MySql).
Has an example table display that demonstrates CRUD operations. i.e. List records from a specific table, a form to edit a specific record as well as pagination and basic search filter.
A menu framework that can be easily added to.
(Ideally) A pre-existing, visually appealing theme.
(Ideally) Has a structure that supports language localisation.
(Ideally) Has a framework for a REST API.
I have seen https://github.com/clevertech/yiibooster which provides a nice set of components that would take care of these requirements, however from what I understand, all the above would still need to be assembled. I know that the YiiFramework is designed to make quick work of this, however I have never used any of these frameworks before and would learn much quicker from a pre-existing example/template (and/or existing Yii application) rather than going through the documentation.
Any help appreciated.

As mentioned by #Bizley, Yii2 Advanced Project Template is a very good starting point to learn the concepts & get hands on with Yii2.
There are several other Yii2 templates available & most of them have been developed by customizing and/or adding features to the Yii2 Advanced Template. Just for your reference here are some Yii2 templates (in no particular order) -
yii2-improved-advanced-template
http://www.yiiframework.com/extension/yii2-improved-advanced-template/
Introduction
Yii2-advanced-template is based on yii2-app-advanced created by yii2
core developers. There are several upgrades made to this template.
This template has additional features listed in the next section.
Application structure has been changed to be 'shared hosting
friendly'.
Features
Signup with/without account activation
Login using email/password or username/password combo.
Rbac tables are installed with other migrations when you run yii migrate command.
Users with editor+ roles can create articles.
Session data is stored in database out of the box.
System setting are stored in config/params.php file ( changes from v2 ).
Theming is supported out of box.
Translation is supported out of the box.
Administrators and The Creator can manage users ( changes from v2 ).
Password strength validation and strength meter.
All functionalities of default advanced template are included in this template.
Code is heavily commented out.
Yii2 Practical App
http://demos.krajee.com/app-practical
Why yii2-app-practical?
After installing a app in the yii2-advanced application you normally
would access the frontend from http://domain/app/frontend/web.
However, in many practical scenarios (especially on single domain
hosts) one would want their users to directly access frontend
as:http://domain/app
The yii2-app-practical enables you to achieve just that by carefully
moving and rearranging the bootstrap files and web components of
frontend to work directly out of the app root. The frontend/web is
entirely eliminated and one can directly access the application
frontend from http://domain/app
All other aspects of the app configuration remain the same as the
yii2-advanced app. The common, backend and console will remain as is.
The frontend config, assets, models, controllers, views, widgets and
components, will still reside within the frontend directory. It is
just the web access that is moved out to app root.
Yii 2 Starter Kit
https://github.com/trntv/yii2-starter-kit
This is Yii2 start application template.
It was created and developing as a fast start for building an advanced
sites based on Yii2.
It covers typical use cases for a new project and will help you not to
waste your time doing the same work in every project
FEATURES
Beautiful and open source dashboard theme for backend AdminLTE 2
Translations: English, Spanish, Russian, Ukrainian, Chinese
Translations Editor
Language change action + behavior to choose locale based on browser preferred language
Sign in, Sign up, profile(avatar, locale, personal data), email activation etc
OAuth authorization
User management
RBAC with predefined guest, user, manager and administrator roles
RBAC migrations support
Content management components: articles, categories, static pages, editable menu, editable carousels, text blocks
Key-value storage component
Application settings form (based on KeyStorage component)
Ready-to-go RESTful API module
File storage component + file upload widget
On-demand thumbnail creation trntv/yii2-glide
Command Bus with queued and async tasks support trntv/yii2-command-bus
Useful behaviors (GlobalAccessBehavior, CacheInvalidateBehavior, MaintenanceBehavior)
Yii2 log web interface
Application timeline component
Cache web controller
Maintenance mode component (more)
System information web interface
dotenv support
ExtendedMessageController with ability to replace source code language and migrate messages between message sources
Aceeditor widget
Datetimepicker widget,
Imperavi Reactor Widget,
Elfinder Extension
Xhprof Debug panel
Extended IDE autocompletion
Nginx config example
Test-ready
Docker support and Vagrant support
Built-in mailcatcher
Assets compression and concatenation
Some useful shortcuts
many other features i'm lazy to write about :-)
I guess these should be more than enough to get you started.

Related

Yii framework for building API's

I have been working with Yii for some years, since version 1. I think is an awesome framework.
Today I need to build a website using Yii which includes building an API, administrator and frontend site.
In the past when I have worked in other similar projects. I shared model between them, each side (api, frontend and administrator) have their own controllers.
With Yii I am trying to find a way to organize it to take advantage of the full power of yii.
I was planning to use API only for mobile apps not for web frontend to be able to use Yii validation rules, etc and speed up the project.
Project owner wants to build a frontend which reads data through API too, that will bring duplicated validation rules etc.
If I follow project owner requirement it will be like managing 3 projects
1. Api + Backend
2. Frontend
3. Mobile
If I follow the other option, it will be like managing 2 projects:
1. API + Frontend + Backend
2. Mobile
Any advice?
Use the advanced application template, make the common directory a git subtree. Then, you can use the subtree in any number of projects. There you are maintaining only one set of models for several applications. Works great for me.

Modules or new Applications?

I've started working with Yii for a month (great Framework) and I am now going to build an application, ERP style.
The goal is to have a main application and then, according to user's roles and permissions, have the possibility to navigate (through single sign-on) to the other applications in the ERP.
I read about modules on Yii's docs and although I got the idea, I was left with some doubts.
Surely it is an advantage to have a One Big application with all the branch applications the company needs as modules but what are the limitations?
Or is it preferable to create seperate entire applications instead of modules inside the main App and then navigate through sub-domains?
Its better and preferred to have modules rather than developing separate applications. With modules you can have totally different look and feel just like a separate application. You must have used Gii tool, well that is also a module within your application.
The main advantage with modules is that you wont have to deploy it separately, it is a self contained application in your website. But again that could be a disadvantage if you need to have total separation of these applications.
To learn more about modules see http://www.yiiframework.com/doc/guide/1.1/en/basics.module

How would I integrate existing zend FW apps into 1 application?

An existing 8+ year old application is being migrated from a self-contained website to a webservice-oriented architecture to allow among other things, external parties access to the calculations and data within the application.
The application allows visitors to access insurance-related information, calculate price quotes and contact agents.
The original logic of the application has been extracted from the main application to a SOAP service - so far, so good.
Based on in-house knowledge of Zend FW, the choice was made to drop the legacy code with many downsides and move to a more robust and community-backed framework - Zend.
An initial Zend FW app has been built that consumes the WSDL and allows searching and displaying of customers. After that was finished we wanted to integrate external applications/modules for components such as a basic (!) cms, mass-mailings, polls etc.
As we consider those components essential for the end-product but not our own core-product, we thus want to use external applications for this.
However - looking at e.g. tomatocms and digitalus etc., they seem to require us to build our product into theirs - and we want it the other way around. CMS pages are the exception, and not the rule.
Integrating authentication among these applications seems very difficult, as each seems to want to be 'the' application.
TL;DR:
What would be the best solutions to integrate a CMS or other apps into an existing/in progress zend FW app?
I think the best solution for you is to create a structure for Modules/Plugins where you set a pattern of use and you will make your application understand these modules created following the specifications above.
With this you allow anyone to be creating or developing models desaclopados their application.
I think this is a good example with your Wordpress plugins. Anyone can create and embed its functionality within the application page, but of course you can make in its API limitations, controlling what you want.

CakePHP Development of frontend/backend application

I have to develop frontend/backend application using cakephp.
can you give me advice how should i develop them, using same cakephp library?
or I have to develop them using separate cakephp libraries?
I am confused - cakePHP would be used to implement both.
PHP would be used to implement the server-side backend. The same "project" would also contain HTML, JS, CSS, etc that will be used to render the front-end within the browser. Any PHP "views" will also execute code on the back-end, although any HTML output will be rendered on the frontend.
Does that help at all? Or am I missing something?
If by frontend/backend, you mean an application with a user interface (frontend) and an administration interface (backend), then you want to refer to the Prefix Routing section of the manual. This will allow you to have separate flow and interfaces (controller/view) for each type of user while sharing the same data (models).
If by frontend/backend, you mean an application (frontend) that communicates with another server application (backend) using web services, then you want to look at the Additional Class Paths section of the manual. This will allow you to share common classes with two (or more) separate applications.
Note: the above links are for CakePHP 3.x, though these features have existed in one form or another since v1.2.
Not quite sure if I understood you correct, but if I did:
You can set up multiple projects using the same cake-core files. The core files don't even need to be placed in the webroot folder..
http://book.cakephp.org/view/35/Advanced-Installation
For your own sanity, you should regard the backend management as part of the same project as the frontend.
The systems I have built generally use view-type methods for the public view and crud-type methods for the admin view. How you lock down the admin is your choice. Personally I don't like the default admin prefix way. I use login and ACL - Mark Story's tutorial on http://book.cakephp.org/ is superb. With that you can password protect methods.
CakePHP is very flexible and extensible and you can make the administration as simple or as flexible as you like.

Need to Assess whether Joomla is good fit for Web Application Requirement

I have a web application that needs to be built using PHP/MySQL. The application will require documents to be generated from data in the MySQL database. Such documents will be printed and/or emailed and user will be prompted to run a daily print/email job based on business logic.
This application functionality needs to be made available to individual users such that they can upload data, have the system prompt them as to whether letters/emails are to be generated. The site also needs to be able to support a bulletin board, online live training events and will have admin area as well.
Question: Should a hybrid solution be developed such that the data management (upload functionality, and letter production) be a separate part of the site that authenticated Joomla users can access? That is, the document management functionality would exist separately from Joomla, but be called from within it via a link in the Joomla sitemap. Alternatively, should custom modules be developed from within Joomla to accomodate the document management functionality?
Thanks so much for your input!!
Joomla could do the job for you but based on the amount of things you need that differ from a normal Joomla site I would use a framework to build from instead of a CMS. I say this because it sounds like you need a lot more than just a CMS and it can be more work if you try making Joomla do things it wasn't designed to do. In my opinion Joomla is for "web sites" and not as much for "web apps". Of course those terms have overlap but it sounds like you would be better off with a Framework to go off of instead of working around Joomla to get what you want. However if the site is already done in Joomla it may be less work just to make a Joomla add-on.
Since you have to use PHP I would definitely recommend CakePHP for your framework. As for an integrated forum try looking at the links in this post. If that doesn't work for you, try out Vanilla forums (vanillaforums.org) which are very clean and may be easier to integrate into CakePHP than some of the other PHP forums.
If you decide to use CakePHP, check out Cake Forge to see if you can find anything there to make your life even easier.
If you were to use Joomla, the upload functionality and letter production would be written as a custom component. You can write the component to make sure that the current user is authenticated before generating the documents. I would not develop this as a separate application alongside Joomla; it would be easier to write it as a component.
Many forums and forum bridges are available for Joomla, so that would be something you wouldn't have to write.
I'm not sure what kind of live event support you're looking for.

Categories