How to generate Laravel Link with anchor - laravel

I use Laravel URL::Route for link pages, And I passed query string like following code, but how to add anchor tag for this?
eg: myproject.local/projects?week_ending=value#anchor
How to do that #anchor part with URL::Route? thank you
URL::Route('projects', array('week_ending'=>$week_end_day))

The most obvious way for that will be:
URL::Route('projects', array('week_ending'=>$week_end_day)) . '#anchor'

Related

How to extend layout based on database

I want to extend a layout which the folder name is retrived from database. Bellow is the code.
#extends('layout.'.{{ $layout->layout}}.'.main')
But it is not working, what is the logic behind getting layout name from database? Please let me know.
you don't need the blade brackets {{ }}. The brackets are short for
#extends('layout.' . $layout->layout . '.main')
I didn't test it but it should work.

Smarty getting page content

I need to edit a page on prestashop, I've found that code
<ul id="idTab2" class="bullet">{$agencies->content}</ul>
And where should i search for that $agencies variable ?
I have found the text which is being displayed into that place in CMS.
However I'd that variable need to be define somewhere, am I right ? Anyone knows where should i search for that ? I'm new to prestashop.
Why am i asking for this ? I need to add another page for example
<ul id="idTab2" class="bullet">{$test->content}</ul>
- but I can't just simply add another page called test.
The {$agencies} variable is being set in a object derived from either the Controller or Module classes but to be honest it looks like you're working with code that has been customised (via a class override or a module) making it impossible to provide a definitive answer to your question without knowing more detail.
If you can locate the term 'agencies' in a file located under \controllers, \modules or \override in your installation, then you will be closer to finding your answer. It will be contained in a function call similar to:
$this->context->smarty->assign('agencies' , [some-variable]);
Note that the parameters to the function may also be passed as an array for multiple assignments.

Codeigniter subfolder named like controller

I'm trying to make folder in controller folder with exact name like controller in Codeigniter. Is it possible by some trick or something?
Screenshot here: http://i.imgur.com/vrQ1J9V.png
If it will be like
/controllers/manage/manage.php
you should add in /config/routes.php
$route['manage/(.*)'] = "manage/manage/$1";
$route['manage'] = "manage/manage";
There is no problem in using the same name, but it is confusing. The best solution would be to change the name, but you can use just fine.
Remember to use the routes with 'manage/manage/function'.
EDIT
I incorrectly viewed the first time and thought manage.php was outside the manage folder.
It will work, but your URL will just have "manage" twice. You could change the routes config to remove the first "manage", but it will be less confusing and time-consuming to just name manage.php something different.

adding attributes to form_open_multipart

I was wondering how could we add attributes to file_upload in codeigniter
right now I am using form_open_multipart('controller');
but I want to add an id attribute to it.
Any help appreciated thanks!
From the User Guide:
form_open_multipart()
This function is absolutely identical
to the form_open() tag above except
that it adds a multipart attribute,
which is necessary if you would like
to use the form to upload files with.
So, you would use it in the same way you use form_open(). Example:
form_open_multipart('controller', 'id="my_id"');
Or:
form_open_multipart('controller', array('id' => 'my_id'));

Magento Store - Get Base URL in Static Block

I have a static block in Magento with this content:
<li>Contact Us</li>
I would like to replace the # with the site's base url. I want it to retrieve this dynamically.
Try adding this to your static block:
Link to Base URL
That should create a link to your store's base URL.
you can use this {{store direct_url="contacts"}}
For example:
contact us
For those that are still looking for a solution, the following should do the trick for you...
For the unsecured base URL:
{{config path='web/unsecure/base_url'}}
Or for the secured base URL:
{{config path='web/secure/base_url'}}
Try this
Contact Us
You can add store URL in static block:
Your link
A bit more clear and practical scenario (for all level of users) would be:
Suppose, we have added a static-block in footer-area/elsewhere. In that static-block we have words like this: Contact Us
And we want to add a cms-page link of that words(Contact Us).
Nice and simple way with elaborated steps:
Step-1: Create a page through CMS>Pages. In 'Page Information' Tab section we set URL Key* page-contact-us
Necessary Text can be written through the content tab area.
Step-2: After opening up our Static-block through CMS>Static Blocks, we have to write the code like this way:
Contact Us
That's all, the Base URL of that Static-block is now activated and can be retrieved dynamically.

Resources