How to select module name in urlfor function inside template - go

Im working in a beego application with 2 modules, and has a controller with the same name in both modules.
When I use {{urlfor}} in template the generated url is linking with the other module.
Anybody know if its posible select module name in urlfor function? I search in the docs and cant see any reference about. Im currently use beego 1.4.3
Thanks in advance

For anybody with the same issue:
The problem is how I implemented the application folder structure for modules. It seems not be compatible with {{urlfor}}.
The correct answer come from github: https://github.com/astaxie/beego/issues/1100
In the link you can found the correct directory tree

Related

PrestaShop working with Doctrine & Entites

Hello :) On start: I use PrestaShop 1.7.6.2 and MySQL 5.6 and PHP 7.2
I want to create a module on new way with Symfony Controller and Entites without ObjectModel (beacouse like say one of develoeper of PrestaShop: Pablo Borowicz - ObjectModel is deprecated)
So on start I create simple module available at the link
https://github.com/DarkSidePro/testmodule
Controller and routing works perfect the problem is when I try use enity manager
$entityManager = $this->container->get('doctrine.orm.entity_manager');
$testRepository = $entityManager->getRepository(TestmoduleTest::class);
$test = $testRepository->findAll();
And I have error like that:
The class 'DarkSide\Testmodule\Entity\TestmoduleTest' was not found in the chain configured namespaces PrestaShopBundle\Entity
Maybe I doing something wrong? But doc of prestashop of coures is suck about new way of creating a PrestaShop modules
Looking 4 help :)
Thx all :)
The PrestaShop documentation is a completely mess concerning the handling of the Symfony repositories.
Doctrine is looking (by the auto_mapping orm configuration attribute) for the presence of your entity under the Prestashop Entity namespace, so given that your TestmoduleTest entity isn't there, it cannot be found and therefore loaded.
You may have to register your entity under the following namespace : namespace PrestaShop\Module\Testmodule\Entity;
You'll be able to find more about how to create your own repository class inside the official productcomments module here.
Ok the problem is on other way :)
In this case i have problem with my Repository class (probably with constructor of this class)
when I deleted them module start work
Problem solved :)

MEAN stack add new module

I created new module with name "mean.recipes". But it's javascript files are not loaded.
I am missing injection of dependency to load those modules but not able to find the place.
I went through javascript files but could not find the exact file.
can someone point me to right file ?
Starting with the documentation helps.. If it's MEAN.io you can find more information here: http://learn.mean.io/#mean-stack-packages-dependency-injection

ZF2 data table - configuring ZFTable

I am looking at zfmodules to get a datatable module, and have found the perfect one :
https://github.com/dudapiotr/ZfTable
..however there is very little explanation of how to configure it into an existing project, change the data source etc.
Does anyone have any experience of this module, or is successfully using it in production?
The thing that i understood from Question is " You want to inject this
Module in your current Application ", well i have checked the link [https://github.com/dudapiotr/ZfTable][1] and the module seems perfect to inject to your Application. *The only thing which seems unfitting is the 'data' folder, you should compile
'customer.sql' onto your database, and then remove the folder 'data', since it does not matches to the framework structure
**Try these steps **
*
create your sql database exactly as mentioned in customer.sql
copy this module to your application, with other residing modules (if any).
Add the module name to application.config.php in Application/config/autoload directory ( since you are adding module manually, you must add your module name there by yourself)
And last, Routing configuration of your module in Application/config/module.config.php
if you need any help in routing of step 4, go here [Zend framework not able to route the translated child routes
*

how can i find the version of codeigniter an application was written in?

I'm reviewing someone's code and I can see that they're using codeigniter. But I'm trying to figure out which version they've used. I've been rooting around in the directory structure to find some information but haven't been successful yet.
Thanks.
Inside the framework, it's defined in 'CI_VERSION'.
Path is system/core/CodeIgniter.php
define('CI_VERSION', '2.1.3');
Simple as this;
echo CI_VERSION;
The constant is globally available and is pre-filled with the release version of the code you have.
Just put the echo in an empty controller and call it in the browser to test it.

How do I include external Libraries in CodeIgniter?

I'm new to codeigniter, and I'm trying to integrate amazon's FPS into my page. There are a bunch of libraries and models that go with Amazon FPS, which I would need included to make the appropriate calls.
How do I include them in CodeIgniter?
I tried placing the entire Amazon folder inside the system/libraries directory, and then tried including libraries with $this->load->library( 'Amazon/FPS/Client' );
However, I run into problems with the relative path there, because Client.php contains the statement require_once ('Amazon/FPS/Interface.php'); ... which is in the same folder.
There has to be a better way to do all this - can anyone please help?
Thanks!!
There is nothing stopping you from directly including classes and working with them however you would in a vanilla PHP setup. If it works in PHP it will work in CodeIgniter.
include(APPPATH.'libraries/Amazon/FPS/Interface.php');
Peng Kong of a3m http://code.google.com/p/a3m/ has a nice way of doing it with plugins:
Example twitter_pi.php
require_once(APPPATH.'modules/account/plugins/libraries/jmathai-twitter-async/EpiCurl.php');
require_once(APPPATH.'modules/account/plugins/libraries/jmathai-twitter-async/EpiOAuth.php');
require_once(APPPATH.'modules/account/plugins/libraries/jmathai-twitter-async/EpiTwitter.php');
/* End of file twitter_pi.php /
/ Location: ./system/application/modules/account/plugins/twitter_pi.php */
In controller
$this->load->plugin('twitter');
$twitterObj = new EpiTwitter($this->config->item('twitter_consumer_key'), $this->config->item('twitter_consumer_secret'));
There is one problem with this in Codeigniter 2.0 there are no plugins
Oh yes codeigniter is nice and has also support for many librarys please have a look here
http://www.haughin.com/code/
Include the Amazon service like this $this->load->library('s3');
#user3526
Note that $this->load->library('classname') will create an instance of that loaded class, not just file (class) include.

Resources