crudkit
crudkit copied to clipboard
RESOLVED: Summary not working
require "vendor/autoload.php"; use CrudKit\CrudKitApp; use CrudKit\Pages\MySQLTablePage;
// Create a new app $app = new CrudKitApp();
// Create a new page mapped to a table $sqlPage = new MySQLTablePage ("flat", "root", "0101", "radamira", array('charset'=>'utf8'));
$sqlPage->setTableName ("flat")
->setName ("Квартиры") ->setPrimaryColumn ("id") ->addColumn ("url", "Адрес страницы") ->addColumn ("name", "Название") ->addColumn ("cost", "Общая Стоимость") ->addColumn ("kvm", "Цена 1 кв.м.") ->addColumn ("type", "(0 = СТУДИЯ) или (1 = однушка) или (2 = двушка) или (3 = трешка)") ->addColumn ("rooms", "Количество Комнат") ->addColumn ("merged_toilet", "Санузел совмещен (1 = ДА) или (0 = НЕТ)") ->addColumn ("full", "Общая кв.м.") ->addColumn ("live", "Жилая кв.м.") ->addColumn ("toilet", "Туалет кв.м.") ->addColumn ("kitchen", "Кухня кв.м.") ->addColumn ("balcony", "Балкон кв.м.") ->addColumn ("windows", "Окна выходят на") ->addColumn ("bal_lod", "(1 = Балкон) или (0 = Лоджия)") ->addColumn ("address_short", "Короткое название дома") ->addColumn ("plan", "Файл с Планировкой") // ->addColumn ("_______________", "________________") // ->addColumn ("_______________", "________________") // ->addColumn ("_______________", "________________") // ->addColumn ("_______________", "________________") // ->addColumn ("_______________", "________________") // ->addColumn ("_______________", "________________") // ->addColumn ("_______________", "________________") // ->addColumn ("_______________", "________________") // ->addColumn ("Country", "Country", [ // Additional configuration using options // 'validation' => [ // 'required' => false, // ] // ]) ->setSummaryColumns ( ["name"], ["balcony"] );
// Add the page to the app $app->addPage($sqlPage);
// Render the app $app->render(); ?>
Resolved > incorrect setSummaryColumns array syntax. Should be: ->setSummaryColumns(array("name", "balcony"));
Thanks
Can I ask why you were using // ->addColumn ("_______________", "________________")
I'm gonna work on adding new features this week and if it's something that can help I can investigate adding it.