Asked  7 Months ago    Answers:  5   Viewed   39 times

Is there any other PHP components like PHPExcel?

 Answers

63

There is some class that generates PHP Excel files (real excel files, not that .csv thing). I use (DEPRICATED) See edit 2:

https://github.com/PHPOffice/PHPExcel

BUT: I have had a problem when trying to read these generated excel files with the java excel READER, so there might be bugs in this PHP script.

  1. EDIT: Nice one: http://www.phpclasses.org/package/2037-PHP-Generate-spreadsheet-files-Excel-xls-XML-format.html

  2. PhpSpreadsheet is the next version of PHPExcel. It breaks compatibility to dramatically improve the code base quality (namespaces, PSR compliance, use of latest PHP language features, etc.). https://github.com/PHPOffice/PhpSpreadsheet

Wednesday, March 31, 2021
 
Niels
answered 7 Months ago
88

Definition of which is the best is very subjective... I have a vested interest when I say that PHPExcel is the best, because I'm the main developer. However:

  • very few of the packages listed in this thread are still actively supported
  • work only with one or other format of Excel files (BIFF .xls or Office Open XML .xlsx)
  • can only read, or only write
  • or require third-party plug-ins, or specific operating platforms

Best is a very subjective term, and it really depends on your exact requirements including

  • whether you are able to use (for example) COM to interact directly with MS Excel on the server
  • or need to both read and write Excel
  • or need to work with xls, or xlsx or both formats
  • or care about ongoing development/support
Wednesday, March 31, 2021
 
tika
answered 7 Months ago
57

Do you mean like Kohana 2.x's flash session variables?

The latest Kohana supports get_once() which is pretty similar to the old flash session variables.

$session = Session::instance();

$session->set('test', 'Hello, World!');

// The session variable is returned and removed.
$test = $session->get_once('test');
Saturday, May 29, 2021
 
Precastic
answered 5 Months ago
36

Found the solution,

  1. In controller add distinct as an array parameter with other pagination options. So if I was trying to retrieve a list of Cars in my inventory with 10 cars at a time, the options would have a DISTINCT clause in the fields parameter and a separate parameter called distinct would also be added as shown below

    $options = array( 'conditions' => $conditions, 'joins' => $joins, 'limit' => 10, 'fields' => array( 'DISTINCT Car.id', 'title', 'user_id'), 'contain' => array( 'Dealer' => array('id'), ), 'paramType' => 'querystring', 'distinct' => 'Car.id' );

    $this->Paginator->settings = $options; $cars = $this->Paginator->paginate('Car');

  2. In Model, use the below function to override the original paginateCount method

    public function paginateCount($conditions = null, $recursive = 0, $extra = array()) { $parameters = compact('conditions', 'recursive'); if (isset($extra['distinct'])) { $parameters['fields'] = 'DISTINCT ' . $extra['distinct']; $count = $this->find('count', array_merge($parameters, $extra)); } else { // regular pagination $count = $this->find('count', array_merge($parameters, $extra)); } return $count; }

  3. No change in View

Saturday, May 29, 2021
 
ariel
answered 5 Months ago
17

The model declaration in $this->Form->create() should not be plural:

<?php echo $this->Form->create('Post', array('action'=>'add')); ?>

It that doesn't solve the missing controller error, please update your original question with the contents of the error message (which controller is missing, for example).

Saturday, May 29, 2021
 
EnTee
answered 5 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :
 
Share