I write custom Drupal module. Want show field_myear in contents. With the following:
<div class="right">
<h4>'.$m_detail->title.'</h4>
<div class="section">'.$field_myear.'</div>
<div class="description">
<div
But when refresh page, get this error:
Notice: theme_news()/home/domains/site.net/public_html/sites/all/modules/site/theme.module dosyasının 1247 satırı) içinde Undefined variable: field_myear.
How can i fix it?
Follow the execution of your page. Step through it line by line. When you are outputting the HTML shown above, you haven't got a value set for field_myear. You need to be sure you are setting it prior to trying to output it - or you need to check your variable name to make certain that it is correct and doesn't have a typo in it.
Related
I have tried to call the function "#include('includes.updates')" and it throws me the error "ErrorException
Undefined variable: updates"
In hompage there are other functions like " #include('includes.listing-creators')" that when called work normally but I don't know why "include.updates" doesn't work.
#if ($updates->total() != 0)
<div class="grid-updates position-relative" id="updatesPaginator">
#include('includes.updates')
</div>
#endif
The code "#include('includes.updates')" should call the list of posts published by users, it is not working on homepage as I mentioned before. Could someone help me how to call the function to make it work on homepage?
I share link of the code that I am using and I want to modify:
https://codecanyon.net/item/sponzy-support-creators-content-script/28416726
I am trying to use Laravel 8 Livewire Modal Popup for data entry with going on another page. But I get undefine the variable _instance and not able to understand it.
#entangle($attributes->wire('model'))
This line creates this error when I remove this from views/vendor/jetstream/components/modal.blade.php. the error will go.
Line no 34.
<div id="<?php echo e($id); ?>" x-data="{ show: <?php if ((object) ($attributes->wire('model')) instanceof \Livewire\WireDirective) : ?>window.Livewire.find('<?php echo e($_instance->id); ?>').entangle('<?php echo e($attributes->wire('model')->value(
x-show="show"
x-on:close.stop="show = false"
x-on:keydown.escape.window="show = false"
class="fixed top-0 inset-x-0 px-4 pt-6 sm:px-0 sm:flex sm:items-top sm:justify-center"
style="display: none;">
This was causing me much angst too but I think I found the solution: as #georgy-malanichev says, you can only call Livewire methods from inside a Livewire component (and not from inside a Blade component or any other custom components).
Given you are trying to use the component inside resources/views/dashboard.blade.php, the solution is to:
create a livewire component using artisan make:livewire MyDashboard
Cut everything between <x-app-layout> and </x-app-layout> in dashboard.blade.php and paste it into views/livewire/my-dashboard.blade.php
Add #livewire('my-dashboard') inside the x-app-layout tags and Bob's your uncle (it should start working)
To help you understand what's going on, if you look at the source code for the modal component, you'll see a line like: show: #entangle($attributes->wire('model')),. I'm not sure how to describe exactly what this does, but, essentially, #entangle() is expecting an instance of the "model" Livewire object and it's not finding one.
It's not finding it because it's getting called from a non-livewire component. Once you put it inside a Livewire component, it starts working.
I hope the additional details makes things clearer.
I was getting the same error but in my case it was the fact that I had x-data="{ open: #entangle('showDropdown') }" outside of the LiveWire component. Once I moved it inside the component template, where it should be, the issue went away.
I have this situation.
Three 'section' elements, on each one i load a view
<section class="col-md-12 col-sm-6">
<?= $this->load->view('folder/view1',NULL,TRUE); ?>
</section>
<section class="col-md-12 col-sm-6">
<?= $this->load->view('folder/view2',NULL,TRUE); ?>
</section>
<section class="col-md-12 col-sm-6">
<?= $this->load->view('folder/view3',NULL,TRUE); ?>
</section>
I can delete, move or edit the view on top and the one on the bottom, but not the view in the middle, if I do so, the browser return me a blank page without errors.
I have enabled all error logs, there is nothing.
Every single view got their tags and php code perfectly idented and closed.
That one is the only one giving me troubles.
What could be the problem?
I would use firebug/ console to see if the view resource is found, or something else related to fetching the asset.
The three includes i´ve posted before are inside another one,
I save the view as cache, for this, I difined the result as a variable and send in to the browser.
$string=$this->load->view('main/mainview',$data,TRUE);
echo $string;
but i skiped an echo $string to send it to the browser, because the last parameter of load->view is false for default but in this way it must be TRUE
i´m still confused about what changes view2 does to avoid this parameter, but after solving it i can edit all file properly.
If someone considers this answer as useless i will delete it as fast as possible
Thanks for your time.
i got alot of these messages
Notice: Undefined variable: config_facontact_address in /home/oclasico/public_html/catalog/view/theme/shoppa/template/common/footer.tpl on line 50
i already seen this answer
Undefined variable (opencart)
, and i tried to do it , but i didn`t find the code to replace :(
and here is my footer.tpl line 50 look like
<?php if ($config_facontact_address) { ?>
<div class="address"><?php echo $config_facontact_address; ?></div>
<?php } ?>
my OpenCart Version 1.5.4
thanks
variable $config_facontact_address is not set,
to avoid this error use if(isset($config_facontact_address))
The reason why it's undefined is because it hasn't been set in the controller file first.
Opencart uses the MVC architecture, varibles are defined in the Controller, then used within the Template / View files. For this reason, it will always evaluate false using isset()
The code missing from the controller file (located: catalog/controller/common/footer.php) would be:
$this->data['config_facontact_address'] = $this->config->get('config_facontact_address');
If your not comfortable editing the controller, then you can replace your problem code with this:
<?php if ($this->config->get('config_facontact_address')) { ?>
<div class="address"><?php echo $this->config->get('config_facontact_address'); ?></div>
<?php } ?>
hi I am developing a module in oxid-esales. It use smarty templates. Now I want to get a particular array index. My code looks like
[{foreach from=$language item=lang}]
<div id="stores">
[{if !array_key_exists($lang->id,$language_array)}]
<img src="[{$join_image}]" /> <input type="radio" name="sys_lang" id="sys_lang" />[{$lang->name}]
[{else}]
<img src="[{$join_image}]" /> [{$lang->name}] [{$language_array[$lang->id]}]
[{/if}]
</div>
[{/foreach}]
But it is creating a fatal error of
Fatal error: Smarty error: [in froomerce_fconnect.tpl line 74]: syntax error: unrecognized tag: $language_array[$lang->id] (Smarty_Compiler.class.php, line 446) in D:\wamp\www\oxid_froomerce\core\smarty\Smarty.class.php on line 1093
I have searched and all where the proper syntax for getting variables in smary is only putting{} brackets. But the CMS oxid enforces me to use [{}] for variables.
Does any body how can I get the value of particular index of array like this
[{$language_array[$lang->id]}]
Regards,
Awais Qarni
Try to change default smarty delimiters.
For example:
$smarty->left_delimiter = '[{';
$smarty->right_delimiter = '}]';
See http://www.smarty.net/docsv2/en/language.escaping.tpl