diff options
Diffstat (limited to 'fai_gestion/plugins/CustomTheme')
4 files changed, 10 insertions, 8 deletions
diff --git a/fai_gestion/plugins/CustomTheme/src/Template/Bake/Element/Controller/_empty.twig b/fai_gestion/plugins/CustomTheme/src/Template/Bake/Element/Controller/_empty.twig index 8175902..3e0a08b 100644 --- a/fai_gestion/plugins/CustomTheme/src/Template/Bake/Element/Controller/_empty.twig +++ b/fai_gestion/plugins/CustomTheme/src/Template/Bake/Element/Controller/_empty.twig @@ -20,8 +20,6 @@ * */ #} -{% set compact = ["'#{singularName}'"] %} - /** * _empty method * Generated when no other actions requested diff --git a/fai_gestion/plugins/CustomTheme/src/Template/Bake/Element/Controller/add.twig b/fai_gestion/plugins/CustomTheme/src/Template/Bake/Element/Controller/add.twig index 1c67f5e..ec3f031 100644 --- a/fai_gestion/plugins/CustomTheme/src/Template/Bake/Element/Controller/add.twig +++ b/fai_gestion/plugins/CustomTheme/src/Template/Bake/Element/Controller/add.twig @@ -38,7 +38,7 @@ {%- for assoc in associations %} {%- set otherName = Bake.getAssociatedTableAlias(modelObj, assoc) %} {%- set otherPlural = otherName|variable %} - ${{ otherPlural }} = $this->{{ currentModelName }}->{{ otherName }}->find('list', ['limit' => 200]); + ${{ otherPlural }} = $this->{{ currentModelName }}->{{ otherName }}->find('list'); {{- "\n" }} {%- set compact = compact|merge(["'#{otherPlural}'"]) %} {% endfor %} diff --git a/fai_gestion/plugins/CustomTheme/src/Template/Bake/Element/Controller/edit.twig b/fai_gestion/plugins/CustomTheme/src/Template/Bake/Element/Controller/edit.twig index d06cb9c..c99b6a2 100644 --- a/fai_gestion/plugins/CustomTheme/src/Template/Bake/Element/Controller/edit.twig +++ b/fai_gestion/plugins/CustomTheme/src/Template/Bake/Element/Controller/edit.twig @@ -41,7 +41,7 @@ {% for assoc in belongsTo|merge(belongsToMany) %} {%- set otherName = Bake.getAssociatedTableAlias(modelObj, assoc) %} {%- set otherPlural = otherName|variable %} - ${{ otherPlural }} = $this->{{ currentModelName }}->{{ otherName }}->find('list', ['limit' => 200]); + ${{ otherPlural }} = $this->{{ currentModelName }}->{{ otherName }}->find('list'); {{- "\n" }} {%- set compact = compact|merge(["'#{otherPlural}'"]) %} {% endfor %} diff --git a/fai_gestion/plugins/CustomTheme/src/Template/Bake/Element/Controller/index.twig b/fai_gestion/plugins/CustomTheme/src/Template/Bake/Element/Controller/index.twig index 8938f6a..78183f6 100644 --- a/fai_gestion/plugins/CustomTheme/src/Template/Bake/Element/Controller/index.twig +++ b/fai_gestion/plugins/CustomTheme/src/Template/Bake/Element/Controller/index.twig @@ -13,6 +13,7 @@ * @license http://www.opensource.org/licenses/mit-license.php MIT License */ #} +{% set compact = ["'#{pluralName}'"] %} /** * Index method @@ -34,10 +35,13 @@ {% else %} ${{ pluralName }} = $this->paginate($this->{{ currentModelName }}); {% endif %} - $this->set('{{ pluralName }}', ${{ pluralName }}); -{% for model in BakeExtra.getFiltersExtraModels(name, modelObj) %} - $this->loadModel('{{ model.getAlias }}'); - $this->set('{{ model.getAlias|variable }}', $this->{{ model.getAlias }}->find('list')->toArray()); +{% for model in BakeExtra.getFiltersExtraModels(name, modelObj) %} + {%- set otherName = model.getAlias %} + {%- set otherPlural = otherName|variable %} + ${{ otherPlural }} = $this->{{ currentModelName }}->{{ otherName }}->find('list'); + {{- "\n" }} + {%- set compact = compact|merge(["'#{otherPlural}'"]) %} {% endfor %} + $this->set(compact({{ compact|join(', ')|raw }})); } |