PHPackages                             costsrl/cost-form-element - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. costsrl/cost-form-element

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

costsrl/cost-form-element
=========================

Navigation based on Laminas

v1.0.0(3y ago)012BSD-3-ClauseJavaScriptPHP &gt;=7.0

Since Mar 24Pushed 3y ago1 watchersCompare

[ Source](https://github.com/costsrl/cost-form-element)[ Packagist](https://packagist.org/packages/costsrl/cost-form-element)[ Docs](http://www.cost.it)[ RSS](/packages/costsrl-cost-form-element/feed)WikiDiscussions main Synced today

READMEChangelog (1)DependenciesVersions (2)Used By (0)

CostFormElement
===============

[](#costformelement)

**What is CostFormElement?**

Sotto public/js e public/css copiare i file presenti nella cartella assets

includere nel Layout.phtml i file js e css di select2-bootstrap

e Cost-\*.js

\-------------- SelectAutocompleteTableGateway ------------------

1. tablegateway\_class = tablegateway chimato dal controller del modulo Cost-form-element
2. tablegateway\_method= metodo chimata
3. tablegateway\_searchfield = campo di filtro

4)repo\_target\_class =classe doctrine in caso di idratazione 5)repo\_method\_class = metodo di chimata per estrarre il dato 6)collaboratore\_id = proprieta che vine chiamata per estrarre il valore /\*\* \* private $coach; \* \* @ORM\\ManyToOne(targetEntity="Collaboratore\\Entity\\Collaboratore") \* @ORM\\JoinColumn(name="generalmanager", referencedColumnName="collaboratore\_id") \* @Annotation\\Type("\\CostFormElement\\Form\\Element\\SelectAutocompleteTableGateway") \* @Annotation\\Options({ \* "label":"Generl Manager:", \* "empty\_option": "Seleziona Gm", \* "tablegateway\_searchfield":"cognome", \* "tablegateway\_class":"collaboratore", \* "tablegateway\_method": "fetchGM", \* "is\_orm\_object":1, \* "target\_class":"Collaboratore\\Entity\\Collaboratore", \* "repo\_target\_class":"Collaboratore\\Entity\\Collaboratore", \* "repo\_method\_class":"getOneGmById", \* "property": "collaboratore\_id"}) \* @Annotation\\Attributes({"class":"form-control"}) \*/

```
---------------------  SelectAutocomplete ---------------------------
1) target_class 	= 'classe entity che verra chimata'
2) property     	= volore combo campo estratto
3) property_key     = chiave combo campo estratto
4) searchFields 	= campo di ricerca
5) orm_tag			= identificatvio dell'oggetto

/**
 * @ORM\ManyToOne(targetEntity="Collaboratore\Entity\Collaboratore")
 * @ORM\JoinColumn(name="segnalatore_id", referencedColumnName="collaboratore_id")
 * @Annotation\Attributes({"id":"segnalatoreid"});
 * @Annotation\Type("\CostFormElement\Form\Element\SelectAutocomplete")
 * @Annotation\Options({
 * "label":"Segnalatore:",
 * "empty_option": "Seleziona Segnalatore",
 * "searchFields":{"codice"},
 * "orm_tag":"segnalatoreid",
 * "class":"Commessa\Entity\Commessa",
 * "property_key": "collaboratore_id",
 * "property": "codice"})

 ----------------------------  SelectAutocompleteTableGatewayOneWay -----------------

 /**
 * @ORM\Column(type="string", nullable=true, name="codicecomunenascita")
 * @Annotation\Type("\CostFormElement\Form\Element\SelectAutocompleteTableGatewayOneWay")
 * @Annotation\Options({
 * "label":"Selezione Comune:",
 * "empty_option": "Seleziona Comune",
 * "tablegateway_searchfield":"codice",
 * "tablegateway_class":"comune",
 * "tablegateway_method": "fetchComune",
 * "tablegateway_method_backend": "fetchValue",
 * "property": "codice"})
 * @Annotation\Attributes({"options":{}, "id":"codicecomunenascita"})
 *
 *
 */
private $codicecomunenascita;

class comune extends BasicTableGateway  metodi

public function fetchComune($term){
    $sql= new \Laminas\Db\Sql\Sql($this->getAdapter());
    $select = $sql->select()->columns(array('codice','comune'))->from($this->table);
    if($term)
       $select->where->like(new \Laminas\Db\Sql\Expression('LOWER(comune)'), "$term%");

   $select->where->isNotNull('comune')->and->notEqualTo('comune', '');
   $select->order('codice ASC')->limit(20);
   //echo $this->sql->getSqlStringForSqlObject($select);
   $result = $this->selectWith($select)->toArray();
   $rs=$this->selectWith($select)->toArray();
        if($flag) $return['']= '';
        foreach ($rs as $row) {
            $row = array_values($row);
            $records[] = array ("id"=> $row[0], "text"=>trim($row[1]));
        }

        return $records;
    return $select;
}

public function fetchValue($term){
    $sql= new \Laminas\Db\Sql\Sql($this->getAdapter());
    $select = $sql->select()->columns(array('codice','comune'))->from($this->table);
    if($term)
        $select->where->equalTo(new \Laminas\Db\Sql\Expression('codice'), "$term");
        $result = $this->selectWith($select)->toArray();
        $rs=$this->selectWith($select)->toArray();
        foreach ($rs as $row) {
            $row = array_values($row);
            $records[$row[0]] = $row[1];
        }
       return $records;
}
------------------------------------------------------------------------------------------------

```

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1196d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8c60285d97462c4a75336d0a8b70c0235c74faba8e37de102a9f3e530b2bbfae?d=identicon)[costsrl](/maintainers/costsrl)

---

Tags

zf2cost-form-elements

### Embed Badge

![Health badge](/badges/costsrl-cost-form-element/health.svg)

```
[![Health](https://phpackages.com/badges/costsrl-cost-form-element/health.svg)](https://phpackages.com/packages/costsrl-cost-form-element)
```

###  Alternatives

[zf-commons/zfc-base

A set of genetic (abstract) classes which are commonly used across multiple modules.

1491.1M25](/packages/zf-commons-zfc-base)[slm/google-analytics

Google Analytics tracking integration for Zend Framework 2

4080.4k](/packages/slm-google-analytics)[dkcwd/dkcwd-zf2-munee

Zend Framework 2 module leveraging 'munee' an asset optimisation library developed by Cody Lundquist. You can find munee at http://github.com/meenie/munee

102.1k](/packages/dkcwd-dkcwd-zf2-munee)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
