Why #this cannot work in my laravel-livewire(mapbox)? - laravel

I try to get the long and lat data from the class, but this "#this" is not working
This is the class:
This is the error:
I'm new in livewire and Json. Your help is a gold for me.

First: You can apply #this on the livewire blade file only
Your Error Path: vpet\resouces\views\customer\location.blade.php (This will definitely give an error)
According to your class right path is: vpet\resouces\views\livewire\map-location.blade.php

Related

Codeigniter 4 - route with parameters (segments) not working

I have problems with routing and I just can't figure out what is wrong.
When I need to take parameter from URI I just can't make my route works.
So this is what I have in route.php
$routes->add('admin', 'Admin/Login::index');
$routes->add('admin/login', 'Admin/Login::login');
$routes->add('admin/gUP', 'Admin/AdminGlavni::g_obrada');
$routes->add('admin/cam', 'Admin/AdminGlavni::cam_prikaz');
$routes->add('admin/cam/edit/(:any)', 'Admin/AdminGlavni::cam_edit_show/$1');
but this is not working (all other routes works as they should)
$routes->add('admin/cam/edit/(:any)', 'Admin/AdminGlavni::cam_edit_show/$1');
When I try to reach mydmain.com/admin/cam/edit/1 I get:
404 - File Not Found
Controller or its method is not found: \App\Controllers\Admin::index
and cam_edit_show in AdminGlavni Class is defined like this:
public function cam_edit_show($id) {
......
}
What is wrong whit my route? Please help.
FOUND ANSWER:
Slash in handler was wrong. It supposed to be \ and not /
I think you have a directory called admin and then your controller called AdminGlavni. I solved same issue by just change the **
I changed / to ** where route call controller with the directory.i think it should require namespace pattern
your code:
Admin/AdminGlavni::cam_edit_show/$1
Try with this:
Admin\AdminGlavni::cam_edit_show/$1
find the below as:
$routes->add('admin/cam/edit/(:any)', 'Admin\AdminGlavni::cam_edit_show/$1');

Cypress visit command produces error when url is a variable

I am trying to run cy.visit() which will take a variable instead of a hardcoded value as its parameter.
In my env.json file I have an environment variable called url, which I've given a value.
{
"env": {
"url": "https://somedomain.com",
}
}
In my spec file, I am trying to pass this variable when calling cy.visit(), like so:
cy.visit(Cypress.env('url'));
When running the test, I am greeted by this error
CypressError: `cy.visit()` must be called with a `url` or an `options` object containing a `url` as its 1st argument
I've searched all over internet for a solution, but it seems like I'm the only person in the world with this exact problem.
Someone knows what's wrong? Thanks!
Edit:
As pavelsaman said, my custom file was not loading. The reason behind this was I had module.exports = (on, config... defined twice in the index.js file. Maybe it will help someone in the future!
In my env.json file I have an environment variable called url, which I've given a value.
Cypress by default looks for cypress.json file, so it seems your env.json is not loaded.
You can check this default behaviour in the docs: https://docs.cypress.io/api/cypress-api/env.html and here: https://docs.cypress.io/guides/guides/environment-variables.html#Option-2-cypress-env-json
I put successfully those env varaibles in cypress.env.json, and access it like that. You probably missnamed the file or you need to the following - since it is a sub object:
cy.visit(Cypress.env('env').url);

PHPBB3and super globals?

I try to customize my PHPBB3 interface.
For that I need to include a header and a footer.
The header file I try to include has the use of...
$this->_agent = $_SERVER['HTTP_USER_AGENT'];
...wrapped in a function.
Here is the error message when I open the PHPBB3 index page:
Illegal use of $_SERVER. You must use the request class or
request_var() to access input data.
For info, the file I try to include works well in any other context than PHPBB3.
Can someone tell me what I have to do and where I have to do it in order to get rid of this error message and have my included file work properly?
Thank you.
You only have to use the request_var() function to access your datas.
$userAgent = request_var('HTTP_USER_AGENT','');
You can find more information about this function here :
https://wiki.phpbb.com/Function.request_var

phmagick class not found on laravel 4

After installing phmagick using composer I'm getting a class not found error. I think it's because of how the Action classes are being loaded, but is there a fix for it?
Have a look in vendor/francodacosta/phmagick/docs/index.html for actual documentation about phMagick. Here's one of the examples which works for me...
$phMagick = new \phMagick\Core\Runner();
$action = new \phMagick\Action\Convert($this->originalFile, $this->newFile);
// optimize the image
$action->optimize();
// sets image quality
$action->quality(70);
// execute the convert action
$phMagick->run($action);

CodeIgniter parser addon

Can't load my_parser class.
Added this http://codepad.org/QtHsyRN3 to application/libraries
than in controller i wrote
$this->load->library('my_parser');
but i am getting
Unable to load the requested class: my_parser
What can be? I need something like this
{if 10 > 8}10 is greater then 8<br />{/if}
But without smarty and etc.
The user guide states you shouldn't include the 'MY_' when calling the library, so:
$this->load->library('parser');
should work - see http://codeigniter.com/user_guide/general/creating_libraries.html
.php file was wrong name. Solutions is "class name = .php file name"

Resources