Laravel 4.2 Class 'Form' not found - forms

I have looked and looked and looked and can find no solutions to this problem. There are solutions for Laravel 5 but I don't think they apply to Laravel 4. Anyone know of the easiest way to get rid of this?
This is the code that causes the problem:
{{Form::open}}

You need to include illuminate/html in composer.json
also remember to register the
service provider : Illuminate\Html\HtmlServiceProvider
and to add the aliases : 'HTML' => 'Illuminate\Html\HtmlFacade'
'Form' => 'Illuminate\Html\FormFacade'
for more information Click here

Related

Selenium, Web Scraping, can't access the class

I am very new to web scraping, It's been several days that I am dealing with the same problem:
Please look at the below line of code(extracted directly from the web page):
< option value='pick' id='ember2314' class='x-option ember view'>To Pick</option
whatever I do I can't access that class:
driver.find_element_by_class_name('x-option ember view') #when I want to print the text here, it says unable to locate element.
But for some other cases, I can easily access the class, and sometimes for some cases, I can't access the class.
Can anyone please shed some light on this? (sorry, I am very new to web scraping)
Please note that the 'id' and 'value' are changing every time so I can't rely on them.
Any help would be much appreciated.
Thanks,
For the people who are beginners like me, here is the solution. It is easy to search it with it's xpath:
//tagename[#attribute='value of the attribute']
so for this case:
driver.find_element_by_xpath('//option[#class="x-option ember view"]')
would do the trick.
From my understanding, the 'class' here is actually an attribute of the tag 'option', so search it like this: find_element_by _class_name('x-option ember view') won't give you anything.

TYPO3 Hook not found

I am currently trying to write a Hook to add extra fields to a Flexform. Therefore I followed this tutorial: https://docs.typo3.org/typo3cms/extensions/news/DeveloperManual/ExtendNews/ExtendFlexforms/Index.html?fref=gc&dti=250938618364487#extend-flexforms-with-custom-fields
But when I go to a page in the backend that contains an options from a Flexform I get the following Error:
Class 'ID\SearchBarAdditional\Hooks\FlexFormHook' not found.
I register the Hook in the ext_localconf like this:
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools::class]['flexParsing'][] = \ID\SearchBarAdditional\Hooks\FlexFormHook::class;
and my Hook-file is here: typo3conf/ext/search_bar_additional/Classes/Hooks
and is initialized that way:
namespace ID\SearchBarAdditional\Hooks;
class FlexFormHook { /* ... */
So in my opinion everything is in the right place and should work, but I do still get the error that TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance("ID\SearchBarAdditional\Hooks\FlexFormHook") fails.
Do you guys have any ideas, what could be wrong? Do I have to register the Hook in \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( or something similar (as the posted code is really the only thing I've done)?
This is a typical class loading error. Check that you added your PHP namespaces to composer autoloading and/or ext_emconf.php and make sure your filenames are correctly named according to PSR-4. If in doubt you can inspect the class loading map files generated by composer in vendor/composer (if you use composer for class loading, which you definitely should do).
I found the mistake: My Hook does indeed not get loaded. I tried to 'include' it in the ext_localconf.php and it is working now.
But as this is of course an extremely ugly solution I posted a second question, how to load a hook here: Typo3 8.X - autoload Hook
Thank you for your help!!!

How to use Router Connect method correctly in CakePHP 2 and 3?

I have a controller MyUsersController with an action login.
I have mapped this with:
$routes->connect('/member/login', [ 'controller' => 'MyUsers', 'action' => 'login', 'plugin'=>false, 'prefix'=>FALSE]);
Now I can access this action "login" using these two urls which is not good for SEO.
http://localhost/cakephpapp/member/login
http://localhost/cakephpapp/my-users/login
So, how can I disable the second URL?
I have tried this code which is working fine but I don't know whether this is correct method or not.
$routes->redirect('/my-users/login', '/member/login');
There is a line in the default routes file that provides the fallbacks so that you can access pages using controller/action. This is really to help you quickly scaffold an app. In CakePHP 3 this is:-
$routes->fallbacks('InflectedRoute');
As commented in the file you can/should remove this line once you have set up the routes for your application. If you remove this it will also prevent your error logs from filling with errors like 'Missing Controller' which can be an issue on a production site, particularly if it is replacing an existing one.
In CakePHP 2 the equivalent line is this:-
require CAKE . 'Config' . DS . 'routes.php';
Removing these lines does mean that you will have to define all routes for your application, but that is probably a better practice than relying on automagic routes of Cake (or any framework). There's a good article on this by Phil Sturgeon: Beware the Route to Evil.

Unable to load class payum in Laravel 4

I have installed payum for laravel 4 but it don't get registred in my app
In my controller
$storage = $this->getPayum()->getStorage('Payum\Core\Model\ArrayObject');
I get the error
ReflectionException: Class payum does not exist
I have gone through the directions at http://payum.org/doc/0.9/PayumLaravelPackage/get-it-started.
My composer.json:
"payum/payex": "*#stable",
"payum/payum-laravel-package": "*#stable",
"payum/paypal-express-checkout-nvp": "*#stable"
My questions is:
Is there any known issues for payum in laravel 4?
Is there any workaround?
Thanks in advance :)
I had the same problem. I solved it add 'Payum\LaravelPackage\PayumServiceProvider' to app/config/app.php file.
'providers' => array(
...
//All yours providers
'Payum\LaravelPackage\PayumServiceProvider',
),
I hope it help you.

Include a module with a ZendFramework library

I'd like to setup a profiler for my company's ZendFramework and Doctrine installation. Right now I have a bar at the bottom that shows up when on a dev environment that gives some basic timing and query counts (much like the Symfony profiler bar). What I'd like to do, is store all of that information and more in a SQLite database and allow viewing of that information in a profiler like Symfony allows.
Is there a way that allows me to include a module with my company's library where all of the code for this profiler can sit? Ideally, I'd want it setup so that a developer could type in "domainname.com/CompanyProfiler" and it would show them the full screen profiler. It doesn't seem like there currently is a way for me to make that routing possible without a new module.
Edit: After seeing the answer about setControllerDirectory, I looked into the front controller methods and found addModuleDirectory, which sounds like exactly what I need. But I can't get it to work.
$frontController->addModuleDirectory(APPLICATION_PATH . '/../library/Company/modules');
If I do a getControllerDirectory after that, I see:
'profiler' => '{really long correct path}../library/Company/modules\profiler\controllers'
In the "controllers" folder, I have IndexController.php with a class name of:
class Profiler_IndexController extends Zend_Controller_Action
But if I try to go to the URL "/profiler", I get a controller not found error. Any thoughts on what I'm doing wrong?
If I var_dump the errors in my error controller, I can see that it is clearly trying to access the default module.
If I understood right, you also want to have the controllers in the library? If so, you can set that ZF looks for CompanyProfiler module where all the controllers are in the library (or anywhere else) using setControllerDirectory().
Try adding a direct route to the module by placing the following in your bootstrap:
protected function _initRoutes()
{
$router = Zend_Controller_Front::getInstance()->getRouter();
// Route for profiler
$route = new Zend_Controller_Router_Route(
'profiler/:controller/:action/*',
array(
'module' => 'profiler',
'controller' => 'index',
'action' => 'index'
)
);
$router->addRoute('profiler', $route);
}