atk4

How to do math operations with model fields or expressions in Agile Toolkit

℡╲_俬逩灬. 提交于 2019-12-08 11:53:01
问题 atk4.2.1 I have this model: class Model_Cargo extends Model_Table { public $table='cargo'; function init(){ parent::init(); $this->hasOne('Alumno'); $this->hasOne('Plan'); $this->addField('fecha')->type('date'); $this->addField('fechaCreacion')->type('date'); $this->addField('fechaVencimiento')->type('date'); $this->addField('name'); $this->addField('monto')->type('money'); $this->addField('cancelado')->type('boolean')->defaultValue(false); $this->hasMany('Abono'); $this->addExpression(

Agile Toolkit localization

人走茶凉 提交于 2019-12-08 04:55:45
问题 I read the answer here for a question about bilingual atk, but I wonder if the framework is adapted for international use? I tested the CRUD functionality (v 4.2) and cannot see that e.g. the labels of the buttons (Add, Edit, Delete) are run through the _() function. Any plans for that? If needed and ATK is the right path, could I assist? If so how? 回答1: Here is the most recent localization branch. https://github.com/atk4/atk4/tree/locale they call $this->api->_() which you can override and

Agile Toolkit localization

好久不见. 提交于 2019-12-07 12:00:31
I read the answer here for a question about bilingual atk, but I wonder if the framework is adapted for international use? I tested the CRUD functionality (v 4.2) and cannot see that e.g. the labels of the buttons (Add, Edit, Delete) are run through the _() function. Any plans for that? If needed and ATK is the right path, could I assist? If so how? Here is the most recent localization branch. https://github.com/atk4/atk4/tree/locale they call $this->api->_() which you can override and make it call _() or any other way. $this->add('translation/Controller_Basic') ->setLocale('de') // default

How to add a field calculated from another model table in Agile Toolkit?

て烟熏妆下的殇ゞ 提交于 2019-12-06 13:08:04
问题 atk4.2.1 I have two models Invoice and Payment, I want to add a field (expression) in the invoice, I can calculate the already amount paid (it can have several partial payment), I added a join and an expression, dut they don't work, what is the right way to write that expression? class Model_Invoice extends Model_Table { public $table='invoice'; function init(){ parent::init(); $this->hasOne('Customer'); $this->hasOne('Plan'); $this->addField('date')->type('date'); $this->addField('amount')-

reference field on form

北战南征 提交于 2019-12-06 09:01:50
I think I'm not understanding the reference field. I have a simple form <?php class page_prueba extends Page { function init(){ parent::init(); $p=$this; $f=$p->add('Form'); $f->setSource('ticket'); $f->addField('line','texto')->validateNotNull(); $f->addField('text','detalle')->validateNotNull(); $c=$p->add('Model_Usuario'); $f->addField('reference','usuario')->setValueList($c)->validateNotNull(); } } And I have a User Model <?php class Model_Usuario extends Model_Table { public $entity_code='usuario'; public $table_alias='u'; function defineFields(){ parent::defineFields(); $this->addField(

FileStore step by step example with 4.2.1

我是研究僧i 提交于 2019-12-02 07:58:58
问题 I am wanting to upload a csv file, validate it, and then upload into an existing model. However, I am using ATK4.2.1 and finding that either the example code that have googled are either missing some steps or not relevant in version 4.2.1. To this end, for my first step I have tried mixing and matching code in attempt to get a fileStore up and running with no working results thus far. Is there a step by step tutorial/guide that anyone can point me to. The reference on the agiletoolkit.org

FileStore step by step example with 4.2.1

孤者浪人 提交于 2019-12-02 04:32:07
I am wanting to upload a csv file, validate it, and then upload into an existing model. However, I am using ATK4.2.1 and finding that either the example code that have googled are either missing some steps or not relevant in version 4.2.1. To this end, for my first step I have tried mixing and matching code in attempt to get a fileStore up and running with no working results thus far. Is there a step by step tutorial/guide that anyone can point me to. The reference on the agiletoolkit.org site does not have any examples for the atk4-addons; that I can find. It seems that it is more involved

ATK4 What is the procedure for setting up an Admin Area?

半腔热情 提交于 2019-12-01 10:46:33
I have setup a CRUD area on my frontendAPI.php file (testing my models)... and I even managed to secure it. I would like to do this the proper way... I would like to establish a separate directory/ Page for the Admins. Please advise on this. Still new at this but I'm trying to do the same for a news page, think i've got the login part working but having problems with the CRUD (will post a question on it shortly) - i have a table to populate with data from an rss feed (but will be manually populated with a CRUD to start with) and then have a page on the front end to pull out the details using

ATK4 model not found when moving to online

感情迁移 提交于 2019-11-29 17:38:40
I am developing a website using ATK4, a php framework with jquery . I have developed this on my laptop using localhost/test1 as the directory and with a local php database. If i move all the directories online and import the php database to my web host, most of the pages work but on one, i get an error on one of the pages indicating Fatal error: Class 'model_TaskType' not found in /homepages/4/d184034614/htdocs/paperless/atk4/lib/AbstractObject.php on line 131 The line referred to in AbstractObject.php is part of the add function. The model is present and exactly the same code is working on

Reasons to NOT use a PHP Framework? [closed]

老子叫甜甜 提交于 2019-11-28 17:26:08
I have always developed web software using a framework ( Agile Toolkit ) and it was helpful to me in all situations, but one question always concerned me: In which circumstances it's NOT advisable to use a framework? So a question to other veteran framework developers - when would you code in a raw good PHP instead of your framework of choice? Flipper There are many reasons that people will suggest not to use a framework. You will learn a lot by writing your own. I have been working on my own and I have learned a lot of different things about PHP that I did not know before. Overall it is a