I wanted to edit placeholder in search box in laravel but i can not find the exact location to edit it.
<input type="text" class="form-control" name="q" id="btnItems" placeholder="Find photos: eg. 'Animals'">
Find photos: eg. 'Animals placeholder -- I can not find the directory in laravel web application, please help.
In your routes/web.php file, look for the route serving the URL you requested
Go to the specified controller in app/http/controller,
Check for the function that's specified along with the controller in your route/web.php file
The function should return a view, something like:
return view('view_name')
Search for the name inside the bracket in your resources/views directory
Related
I am trying to load images from the public folder in the vue components. The asset helper doesn't work in vue , so I need to use the format
<img :src="'img/ic_add-sm.svg'" >
But instead of looking for the images in the public folder , vue is appending the current URL to the image path. For example , if the url is www.example.com/posts
it adds www.example.com/posts/img/ic_add-sm.svg
instead of www.example.com/img/ic_add-sm.svg
Add a forward slash to the beginning of your image path.
<img :src="'/img/ic_add-sm.svg'">
Since you don't appear to be doing anything special you should be able to just use
<img src="/img/ic_add-sm.svg">
At first bind the value of image source
<img :src="getPhoto() + variableName" />
Then create the function under your methods section and simply return the directory location, that's all.
getPhoto(){
return 'images/';
}
Note that, You cant declare directory location directly to :src attribute.
I want to include an input box on site A; after I type in the query and press Enter, open a new tab to display the search results of B. It would be as if I had typed the search query into B directly.
Set up a form to handle the search. Make it's action parameter the address of site B's search handler. Give it a target attribute of _blank
e.g.
<form action="https://storeB.myshopify.com/search" method="GET" target="_blank">
<input name="q" type="text">
<input type="submit" value="Submit">
</form>
These are the basics. You can match the look of your current site by adapting the code from your theme. The code to look at may be in your theme's folders under templates/search.liquid.
I am using a link button in my blade view. The code is as follows:
<a href="conclusion" class='btn btn-default btn-sm'>End Case</a>
The url of the page on which this link button is:
http://localhost/cases/137/responses/30
The result of my button should be
http://localhost/cases/137/responses/30/conclusion
but it is redirecting to
http://localhost/cases/137/responses/conclusion
My laravel route definition is:
get('/cases/{id}/responses/{respId}/conclusion', 'HomeController#conclusion');
What is wrong with it? How can I do it?
The save way to generate URLs is to always use Laravels helper functions. This way you don't have any problem with relative URLs as it always generates a full URL. In your case action() would be appropriate:
<a href="{{ action('HomeController#conclusion', [$id, $respId]) }}" class='btn btn-default btn-sm'>End Case</a>
Alternatively you can give your route a name:
get('/cases/{id}/responses/{respId}/conclusion', [
'as' => 'conclusion',
'uses' => 'HomeController#conclusion'
]);
And then:
<a href="{{ route('conclusion', [$id, $respId]) }}" class='btn btn-default btn-sm'>End Case</a>
Redirecting is not relative to the current path. Its relative to the index.xxx. I suggest that you use a fully qualified path.
The issue is the current url is pointing to a document, not a folder: https://cdivilly.wordpress.com/2014/03/11/why-trailing-slashes-on-uris-are-important/
When using relative href's you actually point to a document in the current folder. While your current url has no ending slash (/) it's interpreted as a document and the relative url will actually replace the document name.
So at this time you are pointing to the document conclusion in the folder http://localhost/cases/137/responses/, because 30 is also "just" a document in that folder.
In order to fix your problem you should hit your page as a folder http://localhost/cases/137/responses/30/ which allows for relative url's href="conclusion" to point to http://localhost/cases/137/responses/30/conclusion
To ensure this works in laravel, your route that points to the response should have an ending /. An even better solution would be to generate the route to the pages using the laravel helper functions like route() and action(); see http://laravel.com/docs/5.0/helpers#urls
I have a razor masterpage (_Layout.cshtml) where I layout a 3 column website. In one of the side columns I want to display a "Login Control"
From my readings, I can use Html.RenderAction to call my LoginController and it will display the login view in the side column.
But, when I run it and point it to a Controller/View to fill the RenderBody(), the call to Html.RenderAction("Index", "LoginController") fails with this error.
"The controller for path '/[insert path to a Controller/View to fill the
RenderBody()]' was not found or does not implement IController. "
So, what am I doing wrong?
My code really is as simple as:
<div id="Navigation">#{ Html.RenderPartial("Test"); }</div>
<div id="Main">#RenderBody()</div>
<div id="Misc">#{ Html.RenderAction("Index", "LoginController");}</div>
And in my controllers folder, I have the controller for the RenderBody and the LoginController.
When specifying controller names by convention in MVC, you don't include the "Controller" part.
Html.RenderAction("Index", "LoginController")
wouldn't work unless you had a controller named "LoginControllerController"
try
<div id="Misc">#{ Html.RenderAction("Index", "Login");}</div>
I create a from statically in HTML file in view project which is inside the module visit.
I want the controller to handle the request occur when submitting the form
<form action="addVisit" method="post">
<input type="text" name="number"/>
<input type="submit" name="save"/>
The structure of the project is
module visits
controller Visits and it has action addVisit
when submitting the form an error occur, the url becomes like this when submitting the form
http://localhost/zendApps/InspectionSys/public/visits/visits/VisitsController/addVisit
in the controller there is a function action
public function addVisitAction()
{
echo 'here';
}
what should I do ?
First you might reconsider camel caseing your actions addVisitAction() because if you do then you have to deal with view file names like add-visit.phtml I think it will affect urls as well, I find it simpler just to leave action names as lowercase addvisitAction(), this might be part of what's amiss.
Next identify your form actions as /module/controller/action (if you are not using modules you can omit that param), so your action should at least be /visits/visits/addvisit or /visits/visits/add-visit (not quite sure which will work properly) .
also when using html forms that were not generated by Zend_Form you can access the values using $this->getParams() or $this->getParam('paramName') instead of $this->getValues().