composer require superrb/kunstmaan-company
Add the following to your /config/routes.yaml
superrbkunstmaancompanybundle_company_admin_list:
resource: '@SuperrbKunstmaanCompanyBundle/Controller/CompanyAdminListController.php'
type: annotation
prefix: /%kunstmaan_admin.admin_prefix%/company
superrbkunstmaancompanybundle_address_admin_list:
resource: '@SuperrbKunstmaanCompanyBundle/Controller/AddressAdminListController.php'
type: annotation
prefix: /%kunstmaan_admin.admin_prefix%/company/address
IMPORTANT: If upgrading KunstmaanCompanyBundle from 1.x.x to 2.x.x, you must run
bin/console superrb:kunstmaan-company:migrate-addresses
prior to running any Doctrine schema updates, otherwise you will lose existing address data.
You can use Doctrine Migrations or a schema update, it is your choice
bin/console doctrine:migrations:diff
bin/console doctrine:migrations:migrate
or
bin/console doctrine:schema:update --force
{{ generate_company_schema() | raw }}
You can access the company
Twig global from any template, for example if you wanted to output the phone number:
{% if company.phone is not empty %}
<a href="tel:{{ company.phone | phone_number_format('INTERNATIONAL') }}">{{ company.phone | phone_number_format('NATIONAL') }}</a>
{% endif %}
{{ company.address("\n") | nl2br }}
You can send a delimiter for the address parts, e.g. a comma or new line.
You can retrieve a list of the available social media links available for the company. The example shows how you can easily create a list of icons and links.
<ul class="social">
{% for network in company.socialMedias %}
<li class="social-item">
<a href="{{ network.url }}"
class="social-link social-link--{{ network.key }}"
target="_blank"
rel="noopener">
<span class="screenreader-text">{{ network.key | capitalize }}</span>
</a>
</li>
{% endfor %}
</ul>
All issues: [email protected]