Sylius add admin Page - php

I'm trying to create an extra admin page in Sylius. However, the documentation does not explain how to create a new admin page. The page I want to create is a subcategory page.
I did manage to create a new route and to create a new controller, but the template uses a lot of functions that are not included in my custom Controller.
Do I need to extend my custom controller with CreatePage or something?

If your page represents a CRUD operation on an entity, then this page will help you do a basic setup.

Related

Register custom controller in sonata admin

Is this possible to register custom controller in sonata admin? Without any CRUD or other completely unnecessary things,
Simple form with one file uploading (no sonata upload, simple input type file).
Just create usual controller with path in admin zone ("/admin/my_uploader" for example).
You can add menu link using custom template for sonata layout.
Another solution is using ConfigureMenuEvent, this way can be better if you write reusable bundle.

Add custom (parameter) route to an existing Magento CMS Page

I need to add an URL parameter to an existing CMS page. I basically created a categories overview page by creating a CMS page with the URL /artists (in my setup artists are equal to Magento's categories).
Now I need to create a custom/parameter route since I need a category-detail-page.
Example: fooshop.com/artists/artistname
where /artists lists all existing artists (categories) and /artists/artistname just shows one artist (detail) page.
One way to do so would be creating a simple URL rewrite (htaccess) to map all requests to /artists/someparameter to /artists/ but I was wondering if there's a more elegant solution by using Magento's default controller/view structure?
I ended up in writing a custom module that uses a custom controller that extends Mage_Core_Controller_Varien_Router_Abstract.

Integrate non-admin page in sonata admin project

I need to put a non-admin page/view inside my admin project build using Sonata Admin Bundle. Is there a correct or standard way to integrate an independent page within the admin, make it accesible trough the dashboard or menu, and display it using the layout and all styles of the whole backend admin (including form styles)?
The only way I imagine how to do it is create a custom controller, an make the views use the same twig layout of the admin, but I think of it as a "brute force" way.
The way you stated seems the best one indeed. By taking a look at the dashboard page in the Admin, it is simply a controller rendering a template that extends the base_template of the sonata.admin.pool service.
You may then override the standard_layout.html.twig template to throughout the admin (don't forget to put it in the sonata_admin configuration as well) to customize the menus and add your link.

How can I switch between the different theme while moving from different actions of same controller or different controller in YII

I have just started YII one week back. I have made a theme in that is
\themes\yog
it is very small project, just 4-5 forms, those are mostly fro the admin. so what i want now it suppose i am using the
site/login
route, I want to render it via YII's default views . i.e
\protected\views
I want to run the default views for only some actions, like login, or adding news, event and other admin related tasks. But other actions should render the views from my new theme.
Thanks.
In that SiteController set Yii::app()->theme to a non existing theme, and it should fall back to use the views from the protected/layouts file.
If you want to specify different layout files read this: Yii: Render action using different layout than controller's layout

How do I create the widget automatically on PyroCMS?

I'd like to develop a module as an event with registration form. An event is actually a page module with slight modification by adding some fields such registration form url. When the controller return a view, I'd like the controller to return a registration form widget along with the event info (article) and a google maps widget.
Imagine a widget class:
<?php
class Registration_Form_Widget extends Widget{
......
}
My question is:
Is it possible to create widget dynamically (I mean the creation of widget instance is dynamic (not the content) such using new Registration_Form_Widget and bypass the parameter such the registration form url that has been stored to the database?
So far, I never see an example that show how to create widget instance dynamically with automatic increment id
thanks...
Nope, widgets are created whenever you create em.
Although it is obviously possible to achieve it with a bit of code.
There is no "magic function" to do that automatically, but you can look into the widget module files to understand what is done when a user create a widget in the admin CP. And then you could reproduce the behaviour yourself.

Categories