Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm using CakePHP (v3.0) and I want to create a bar chart.
I have tried to use "libchart" and "pchart" libraries but always I get problems (I think that namespaces is one of them..) to import and use these libraries on my controller class...
What's the simplest way to create a bar chart on CakePHP 3 ?
You can place the chart libraries in vendor folder and include them using PHP's include function.
To call their class just use a backslash before them to make them a Fully qualified name like
$chart = new \VerticalBarChart(500, 250);
Now you can use $chart without any issues.
References:
PHP Namespaces
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I am working in this script. I am trying to use use PayPal\Rest\ApiContext; code in my controller. I can't use composer.
In this regard How can I use PayPal ?
I am getting below error.
It's hard to believe you "can't use composer" as it looks like the project is using Laravel which has autoloading. Without proper autoloading set up, for this class to be found you'll have to add require statements to your project -- and you'll need to require each PayPal API source file so you don't get additional class not found errors. This is the "old" PHP way of doing things.
See https://www.php.net/manual/en/function.include.php for documentation.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I need to give client to a print a receipt through my website directly. I know we can not do it via php because it is a serverside language. I have tried do it by using WebClientPrint.php. But I was unable to implement it. I need to know is it possible to implement such option in CodeIgniter
You need to use js for printing:
var w = window.open('files/invoices/invoice.html','name','width=800,height=500');
w.onload = w.print;
w.focus();
If you need to generate the file then use ajax to do that & then use the file path to print using above js functions.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
While Looking into a PHP Plugin i saw a line ,
$this->banks[0] = new Population();
It seems like they are declaring a object in a array variable. What is the use of it?
For what you described, it seems they're using a common pattern called Singleton that is useful in the way that you have all objects and their states accessible from only one common object.
It all depends on how the PHP plugin works.
The advantage of using a class instead of the array allows you to create function for a better data manipulation (e.g. a population class could have a function getPersonByName or getPersonsByAge which makes it easier instead of making a new loop each time.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am new to php so it did not seem like a good idea to use the framework.
I want to create my own framework from strach.
I want to open php class with a url like what codeigniter do.
I want to use urls like index.php / MyClass instead "get" index.php? class = MyClass.
how can I achieve that?
You have made good decision to develop your framework . This is known as Routing or URL Rewriting . You can learn this at URL Rewriting. For a complete framework , You have to learn about
Template System
Query Builder etc
I suggest you to learn Codeigniter framework for better understanding of PHP framework
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I've used Doctrine together with frameworks like Symfony or Zend. Is there a way to use it without such a framework, with plain, core php?
I've used Doctrine together with frameworks like simfony or zend. Is there a way to use it without such a framework, with plain php?
OF course. you start here , right from the doc :
http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/tutorials/getting-started.html
What i mean is you should really have a look at the doctrine doc if you did not.