Closed ceesvanegmond closed 11 years ago
Hmmm not sure. Have you loaded the app/models/admin directory or namespace in your start.php? Is it telling you where in the code the error is occurring?
Yes, i registered in the start.php Here is my stack trace:
Stack Trace:
Ah ok that helps narrow it down. Do you have any fields defined in the contacts table? Could you share what that table looks like? Also could you show me what's in your contact.php model?
The table itself:
id -> primary_key name, varchar email, varchar phone, varchar sortorder int
The eloquent class:
<?php
class Contact extends Eloquent {
public static $table = 'contacts';
}
The admin
<?php namespace AdminModels;
class Contact extends \Contact {
}
Alright right off the bat I can tell you that $columns, $filters, and $edit properties on your model are required (check the docs). This particular problem is happening because you have no $columns defined. Think about it like this: in order to determine how to make that SQL statement, the Administrator code needs some point of reference, which in my code is the $columns property. Without that, it's searching in the dark. As you might be able to tell, I need to throw some Exceptions in case people run into this sort of thing again by accident.
Please add those $columns, $edit, and $filters properties and let me know if it works!
In a future release (like...within a week or so), I plan on allowing for empty $filters and $edit properties. At the moment I don't know if there's a cross-driver way to get a table's columns without there already being some data in the table. Blank Eloquent objects don't have any attributes, and so it makes it difficult to do anything unless you define the $columns you want to show up in your administrative table. Because of that, for the foreseeable future, you will always have to define the $columns array in your model.
Read the docs for more info!
Ah, that works! Thank you! Awesome! Maybe an idea to work out, to order the records by draging them with jQuery UI Draggable!
Awesome, glad it's working! That's definitely an interesting idea. I will try to think of a good way to put that in!
Hello there,
I constantly get the following error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM
contacts
WHEREid
= ? LIMIT 1' at line 1SQL: SELECT FROM
contacts
WHEREid
= ? LIMIT 1Bindings: array ( 0 => false, )
I simply have installed the bundle, created an 'admin' folder in the models dir, created an file called contact.php in the new dir.
This is the config
The Frontend itself is working properly.
Any idea how this is come?