How can we added a controller by using WF admin? - php

My boss give me some assignment to find information "How to add a controller by using wildflower admin (dashboard)? and how can we manipulate it (wf admin)?". I've searched each with Google but it's too difficult to find it. Maybe I'm not so great to do the research job. So, please help me you guys.

Wildflower is a CMS built on the CakePHP framework. A controller is a code construct used in the CakePHP framework. If I understand your question correctly, what your boss is asking for is some way to make the application write code into itself...
However, if I understand your boss' intent correctly, it sounds like he wants something like Drupal's Content Construction Kit (CCK) in Wildflower which, as far as I know, doesn't exist.
CakePHP comes with a console app called "bake". You can quickly create "scaffolding" for a model by running some bake commands. In theory, you could write an extension for Wildflower that could send commands to bake to generate scaffolding for quick add/edit/delete interfaces for those models.... but they wouldn't integrate with the WF admin or WF in general.
With all the effort it would take to build an interface like that, you could just add the new models to the application yourself, or build a proper CCK-like extension for WF.

Related

Building Simple REST API using PHP without framework

I want to build a REST API using PHP, but without any framework. By the following requirments:
The code should be as simple as possible with OOP development principles in mind, easy to read and expand
Data should be kept in MySQL and to be returned as JSON in the given format
DO NOT use ANY Framework or ANY already written code, but to have structure
User input data validation
There should be no security issues
At first, I thought I should build complete MVC project, but I realized that actually I will probably don't need any views and I will use Services instead of controllers. And also models for both entities (Articles and Users).
I'm still not sure what is the perfect way to do it, so I will just tell you what I`m thinking so far...Sorry if Its a duplicate post but I haven't found much information about this and from the little I found, I got more confused.
I thinking of a simple router.php class that will have a method:
map($httpMethod, $route, $callback)
So, for example, I will call ("POST", "/users/register", registerUser(params)) or ("GET", "/users", registerUser(params)), just like I would do in a MVC web app.
I think I will need a model and a service for each of both entities. The service will execute the SQL for each CRUD operation. I think I know how to create the service, as it won't be much different than a controller.
But I wonder how can I create the model part for both entities. What exactly I will need for the models as a code?
First of all, it would be nice if you agree that this is the right way and if not, I would love to hear a lot of criticism because I'm currently confused and really don't know where to start.
I agree with you.
And suggest you to know about Loopback, it's good, like what you described.
I know your question is how to build your own rest api without framework, but it sounds like you'd actually make good use of at least some components (not necessarily a whole framework), do you really need/want to write a router from beginning?
if so sure, if no maybe some microframework? anyway, symfony has some info on how you would create your own framework (just as an example), they use couple of their own classes (i.e. httpcomponent), but just for the explanation of idea/way how things you want are done.
https://symfony.com/doc/current/create_framework/index.html
I found this library in PHP for get started with REST API's
php-platform/restful
This requires prior knowledge on using Composer

Laravel API Generator

I have a project and I'm only responsible for the Back-End development.
In the Back-End I have to create an API that generally have CRUD operations, and the problem is that they are a lot, so to explain exactly here is an example:
Demand => Create a CRUD for Article(Id:number, Title:string, Thumbnail:picture, Content:text, Tags:text)
Explanation => I have to create everything needed so the Front-end can send requests to Create, Read, List, Update or Delete an Article (Return data as JSON)
Problem => I'm searching for a package or a tool that generates that automatically, knowing that a request could contain files or pictures not only text data.
Please Don't Forget
I'm not seeking for a view generator [I'm not working for the Front-End] I'm only responsible for the Back-End
Everything I need do exist in other frameworks, but I want to work with Laravel
I wish you give me tools or packages that you have used not from Google searches because I'm searching for the 4th day
I found this http://labs.infyom.com/laravelgenerator/ but it seems that it have a little bit complicated documentation (Maybe the problem in me)
I'm using Laravel 5
There are several great options for automatic generation of api in laravel you can checkout Dreamfactory, infyom or apiato, I recommend infyom if you have a small project and you need simple api.
It's not totally clear to me what you're looking for. Regarding routes and controllers, Laravel's built-in functionality for Resource Controllers is quite useful in providing general REST scaffolding. If you're interested in all the details of implementing CRUD-like functionality, that's a more involved topic and I'd advise spending some time reading through Laravel's fairly comprehensive documentation.
Try Laravel API/Scaffold/CRUD Generator

Zend Framework 2 - Interfaces, modules and controller

I'm new to Zend Framework 2 and I'm trying to build an application for (so far, moderate) "fun" and I need some hints to know how should I structure my application.
I have a existing module that allows me to display some web pages with 2 controllers and a database access.
My application is aimed to use Git's system commands or the GitHub API or the BitBucket API depending on the situation.
I thought of making a interface that "prototype" my methods and make 3 classes that implements it but I don't know if it is possible with the framework, if it is the best way to do it, if I should create a entirely new module to do so, if I should write those methods in diffrerents controllers or if I would be able to call those methods in my current module.
I would really appreciate if you could either answer my questions or provide my a ressource that could help or at least give me some hints.
Thank you
Your thoughts on using an interface sound like the right approach, assuming you want system/Github/BitBucket to be interchangeable.
The rest of your questions relate to organising your app code, to which there is no 'correct' answer, and you are in the best position to judge this; so do what seems most sensible to you. The only thing I'd say is that if you can forsee wanting to use part of the functionality in another application, or wanting to let other people use it, it might make sense to split that part out into its own module.

Making joomla Extension in my own way

I've tried to understand the structure of joomla. I've read many kinds of documents and tutorial regarding about how to make extensions in joomla. I can't able to understand it fully. I still had some doubts on it. I've made a simple component in joomla by using MVC concept and using some joomla core files. I won't say that it is like same as what professional are making it. I've used 30% of joomla like using MVC concept, extending the core files of joomla and connected with the database using joomla syntax and some other ways also. Rest of the percent, i've used my own codes by using oops concept. So do you think that is it good enough to make an extension like this or i have to make an extension like that or i really have to learn and understand the official joomla way of making it's extension. I want to know it please.
First of all the joomla is given a brief details for developing its extensions.
You can check the following url for understanding the components structure of joomla.
http://docs.joomla.org/Developing_a_Model-View-Controller_Component/1.5/Introduction
In this doc at the end you can find a download link download the component and go through the code you will get full idea about joomla MVC concept.Its pretty simple.
I think no one can explain your requirement with what you are expecting.
Just keep this in mind while developing joomla's extensions.
1)Do not edit core file for your component task achievement.
2)Try to use jRequest class for getting submitted values.
3)For new task use your controller overrided functions.
4)Make all your sql queries inside model only.
5)And make an extension that compact able for later version too.
These are the tips i can give you.
Just walk through the code of some good extensions and try to follow that .
Hope this may help you..
For ease of maintenance and for future development I would definitely recommend that you develop your component the right way. If you are going to release the component I would say that it is a requirement.
The who MVC structure can be confusing at first but once you get your head around it is really nice.
I would suggest making the MVC skeleton by using the Joomla Component Creator
http://www.notwebdesign.com/joomla-component-creator/ and then add the custom code yourself.

Is there any skeleton project made with Kohana that makes use of authentification and database?

To get started with Kohana quickly, I wonder if someone has ever made an sleek skeleton project that makes use of all basic things every web developer needs:
basic user authentification with login
retrieving some stuff from an MySQL database and displaying it
By hand I would do this pretty fast. But with Kohana it feels like I have to climb up the Mont Everest to achieve it. They don't provide any complete examples, just code fragments for all kind of stuff. It would be cool to have some "basic shape" from where to start making an dynamic platform. I mean, nowadays alsmost every website needs to have some kind of authentification, login and stuff like this.
If anyone knows a simple basic working skeleton project example that's not blown up with tons of freak stuff like ajax & co, a link would be cool.
This project/tutorial looks like it'd be worth checking out: http://remorse.nl/weblog/kohana_auth_module_a_better_one/. It was written by someone who wasn't very happy with the default auth module in Kohana.

Categories