Creating a new extension
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Creating a new extension
Good day.
I am trying to create a new extension. The extension will store site data in the database.
For this, I created a new directory automatically. I also added some files to it - ext \ myEXT \ admin \ jqadm \ src \ Admin \ Jqadm \ Settings \ Factory.php and Standard.php. And the presentation files are ext \ myEXT \ admin \ jqadm \ templates \ settings \ item-standard.php and add navbar.php and admin.php. After add ext \ myEXT \ lib \ custom \ src \ Settings \ Manager \ Factory.php and I’m not sure about the error class "\ Aimeos \ MShop \ Tag \ Manager \ Settings \ Standard". Tell me, I want to make a new extension, so which class should I inherit from in the file
ext \ myEXT \ admin \ jqadm \ src \ Admin \ Jqadm \ Settings \ Factory.php and Standard.php to not receive an error. So how is the extension different from the standard, should it be some kind of baseline? Help me .
I am trying to create a new extension. The extension will store site data in the database.
For this, I created a new directory automatically. I also added some files to it - ext \ myEXT \ admin \ jqadm \ src \ Admin \ Jqadm \ Settings \ Factory.php and Standard.php. And the presentation files are ext \ myEXT \ admin \ jqadm \ templates \ settings \ item-standard.php and add navbar.php and admin.php. After add ext \ myEXT \ lib \ custom \ src \ Settings \ Manager \ Factory.php and I’m not sure about the error class "\ Aimeos \ MShop \ Tag \ Manager \ Settings \ Standard". Tell me, I want to make a new extension, so which class should I inherit from in the file
ext \ myEXT \ admin \ jqadm \ src \ Admin \ Jqadm \ Settings \ Factory.php and Standard.php to not receive an error. So how is the extension different from the standard, should it be some kind of baseline? Help me .
Re: Creating a new extension
Use this as your class header for your Factory class:
Your class header for your Standard class must look like:
The error you receive is due to using a wrong manager name. Look for
which doesn't exist.
Code: Select all
class Factory
extends \Aimeos\Admin\JQAdm\Common\Factory\Base
implements \Aimeos\Admin\JQAdm\Common\Factory\Iface
Code: Select all
class Standard
extends \Aimeos\Admin\JQAdm\Common\Admin\Factory\Base
implements \Aimeos\Admin\JQAdm\Common\Admin\Factory\Iface
Code: Select all
\Aimeos\MShop::create( $context, 'tag/settings' )
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Creating a new extension
I understand that for the class that is ext \ myEXT \ admin \ jqadm \ src \ Admin \ Jqadm \ Settings \ Factory.php? But there and there it is. If for the class on the path ext \ myEXT \ lib \ custom \ src \ Settings \ Manager \ Factory.php, then after it asks to implement the create method and I get 2 identical classes - this is not correct. Tell me correctly, I understand - this class - ext \ myEXT \ admin \ jqadm \ src \ Admin \ Jqadm \ Settings \ Factory.php handles our tasks, but this ext \ myEXT \ lib \ custom \ src \ Settings \ Manager \ Factory .php rewrites the parent? In the class I need to describe the possibility of adding, editing data from the database, but how can I do this? Now I got a new Unable error to call method "getSubManager", /var/www/siteName/ext/ai-admin-jqadm/admin/jqadm/src/Admin/JQAdm/Base.php:51
Re: Creating a new extension
The classes in "ext \ myEXT \ lib \ custom" have nothing to do with the JQAdm classes. The JQAdm factory creates the Standard JQAdm class and inside this class, you can use classes from "ext \ myEXT \ lib \ custom". If you have implemented such a class which must be named "\Aimeos\MShop\Settings\Manager\Standard" and located in ./lib/custom/src/MShop/Settings/Manager directory together with another Factory.php class (not to confuse with the JQAdm Factory class), you can use it in your JQAdm Standard class for storing data.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Creating a new extension
Thank. I seem to be beginning to understand my class Factory -> Standard and in the Standard class there is an appeal to Class "\ Aimeos \ MShop \ Settings \ Manager \ Factory" not available but since this class is not there I need to describe it in my extension? (I copied to my Factory and Standard classes from ext \ ai-admin-jqadm \ admin \ src \ aimeos \ admin \ jqadm \ group). Tell me how can I better access the database in which file? And what methods?)
Re: Creating a new extension
It's depends what you want to achieve? Where will the settings be used? Would you like to merge them with the existing file based configuration?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Creating a new extension
In the admin panel of the site there will be a separate tab with the settings from the settings table, they will be displayed on it and they can be edited. Tell me how can I get this data from the database and edit (as I understand it, editing occurs when filling out the form and sending it and after receiving the data method and changing them in the database)
Re: Creating a new extension
You can either store them directly in the database if you just want to merge them later to the config object in the context:
You can also use a Laravel Eloquent model for this instead.
Code: Select all
$dbm = $this->getContext()->getDatabaseManager();
$conn = $dbm->acquire();
$stmt = $conn->create( 'REPLACE INTO settings (key, value) VALUES (?, ?)' );
$stmt->bind( 1, $key );
$stmt->bind( 2, $value );
$stmt->execute()->finish();
$dbm->release( $conn );
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Creating a new extension
Thank. I figured it out.
Tell me when saving my data should work out the save method which is Aimeos \ Admin \ JQAdm \ Settings Standard. But when you click save nothing happens, the action will enter the address / admin / default / jqadm / save / settings? Lang = en
Tell me when saving my data should work out the save method which is Aimeos \ Admin \ JQAdm \ Settings Standard. But when you click save nothing happens, the action will enter the address / admin / default / jqadm / save / settings? Lang = en
Re: Creating a new extension
You have to implement what should be done in the save() method of your JQAdm class.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star