Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 10 months ago.
Improve this question
I am a PHP beginner and learning Laravel (currently Laravel 9). I have seen some tutorials, and I am experimenting with them. I noticed that there are many classes defined in the framework itself. I want to know whether there is a guide explaining the implementation and usage of these classes.
For example, there are Illuminate\Http\Response and Illuminate\Support\Facades\Response classes. Both seem to have the same usage, but I could be wrong.
There are some other questions, too, like a global namespace response() which creates a new response instance, so why would I use Illuminate\Http\Response or Illuminate\Support\Facades\Response to create a new instance?
Are there any guides where it specifies when, where, and why we would use those classes?
Are there any rules for such situations?
I also couldn't find a complete guide for handling audio files and creating an audio player before finding the solution here in ronline's answer.
You can find more information about the Laravel classes in the API.
In the case of Illuminate\Http\Response and Illuminate\Support\Facades\Response, you can find them here:
https://laravel.com/api/master/Illuminate/Http/Response.html
https://laravel.com/api/master/Illuminate/Support/Facades/Response.html
If you want more info on the difference between Illuminate\Http\Response and Illuminate\Support\Facades\Response, the facade doesn't have the header method. This is answered here (in the comments):
Laravel 5.2- Call to undefined method Illuminate\Support\Facades\Response::header()
This website seems to give more information on response objects:
https://laravel-guide.readthedocs.io/en/latest/responses/
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
In a Drupal project, the following calls are being made. in different APIs
<?php
function GetAllCities($decrypted_json)
{
echo file_get_contents(public_url."city-view");
}
?>
Moreover I see the following in different scripts:
echo file_get_contents(public_url."stylist-services?stylistnid=".$decrypted_json->stylistnid);
echo file_get_contents(public_url."sub-category-view");
Now I am unable to get to the definition of the following calls in the above code:
city-view
stylist-services
stylistnid
sub-category-view
When I echo the public_url, I get the following response
http://x.x.x.x/drupal/
I am just looking for a way to understand what these calls are and what these do. There is no documentation, no comments, no hint.
Let me know if I can provide any more information.
We don't know exactly what those functions do just from the names - maybe you get different data if you pass some parameters to it (e.g. to restrict the list). Who knows, without seeing the method or any docs.
You should read the Drupal docs to see how views are defined in that framework. There will be a structured way to do it, so then you might be able to logically work out which bit of code is providing that function, and then read it to understand what it can and cannot do. If you're really lucky the code may be commented in a useful way explaining the functionality!
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I want to learn OOP PHP, and I think I need to know all predefined classes of PHP. However I cannot find any website that has list of them. On php.net i only find functions and there are examples of doing it oop or procedural way. Does anybody know where should I find those classes? Big thanks for replies
There is a function for that: http://php.net/manual/en/function.get-declared-classes.php
Note that this doesn't output interfaces, but there is also a function for that: http://php.net/manual/en/function.get-declared-interfaces.php
Remember that this will give you all classes of extensions that are currently installed, as only these are available. It will not include classes or interfaces that are available in extensions that are not installed.
However, learning OOP is independent from knowing all existing classes. If you want to do something concrete, like accessing the file system, I'd think it appropriate to then read about file system classes and their OOP interface, but it would be useless to read about the Memcache class if you don't want to use Memcache. Most of the time in OOP you create your own classes and program the business logic of the application - you will encounter built-in classes very rarely, because usually you'd add a wrapping or isolating layer around their results pretty soon, and then pass these (your own) objects around.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
Is there an automated way or utility that can be used to document a cakephp application. The client is requiring I provide technical documentation for others that will be working on the site, so I need a way to list out all the views, controllers, models, components, and helpers. At least I need some sort of skeletal documentation that I can fill in with more meaningful instructions and descriptions. Any links to anything that can do this would be helpful.
Use docbook for you PHP classes and methods. phpdoc also allows you to include external files with documentation for i.e. your views.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I have generated my REST API, and now I have to write a documentation for the API.
As the API is mainly generated by a third-party plugin it's not possible to generate the DOC automatically.
So what the best tool (to save time) to manually write a DOC?
PS: I do have github account, I wonder if the user pages can fit this need.
You might want to take a look at TechWriter for Web Services. It also supports generating documentation for REST APIs.
You can spent sometime to put DocBlock into all function/class you have built
A tool like PHPDOC is available for you to compile DocBlock into documentation and regenerate whatever you need (into your desired format).
Not to mention, is stored as static HTML
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
Anyone written or know of a decent PHP helper class written for Constant Contact's new REST API?
I've looked at their sample application... has a bunch of inline examples... helpful, but I'm thinking I want to either find or write a helper class to fully encapsulate the API so that all one has to do is interact with the PHP object.
I actually just started this project myself. It does almost everything the REST APIs allow. It will probably help you get off the ground with your integration.
http://www.envoymediagroup.com/Code/CTCT-Web-Services-PHP-Library.html
They have a PHP sample application:
http://img.constantcontact.com/webservices/samples/PHPSample.zip
This is an old thread, but I thought it would be helpful to add in the official Constant Contact PHP SDK wrapper: https://github.com/constantcontact/php-sdk
An old thread, but thought people might be interested in a V3 PHP client:
https://packagist.org/packages/phpfui/constantcontact