ATK4 model not found when moving to online

前端 未结 3 1713
-上瘾入骨i
-上瘾入骨i 2020-12-22 00:58

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 dat

3条回答
  •  抹茶落季
    2020-12-22 01:52

    in my experience with ATK4 (v4.1.3) this error is more likely a case-sensitivity and folder search declaration problem.

    as the ATK4 PathFinder is the one responsible for loading all the classes, when you add() an object, like, Model_UserAccess it looks for different locations particularly: Model/UserAccess.php it then include() the file and then instantiates the class Model_UserAccess inside it, something like return new Model_UserAccess().

    PathFinder changes all instances of underscores _ to / and traverse the locations accordingly.

    therefore, a declaration something like this:

    class Model_UserAccess extends Model_Table

    and adding it:

    $m = $this->add('Model_UserAccess');

    searches and loads two files (not in particular order), 1st from: /Model/Table.php and 2nd from: /Model/UserAccess.php

    once you are comfortable with this folder separation concept, developing in ATK4 will be much much easier.

    i myself have a /lib/Model/ and /lib/Form/ and even a /lib/Form/Field/ since i am also redefining up to the field level. The latter would look something like:

    class Form_Field_GraduatedSlider extends Form_Field

提交回复
热议问题